You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, everyone:
when i use gmail to send a email, i choose the text/html contentType. And the body string i edit a whole html string. But i only receive the body that i send with the gomail.
It is very normal for me, not a bug. Web client is not a web browser.
In the context of a mail, the subject is the title, you set it as any other header:
m.SetHeader("Subject", "Newsletter from your prefered online shop").
m.SetBody only takes ... the body part of your html ! Not strange.
Another limitation is that you cannot probably "css style" the content of the body since it is done using the HEAD balise, not the BODY. This is more problematic for me.
Hi, everyone:
when i use gmail to send a email, i choose the text/html contentType. And the body string i edit a whole html string. But i only receive the body that i send with the gomail.
the code is:
`
package main
import (
"github.com/go-gomail/gomail"
"crypto/tls"
)
func main() {
m := gomail.NewMessage()
m.SetAddressHeader("From", "xxx@xx.com", "test")
m.SetHeader("To", "xxx@xxx.com")
htmlBody :=
<html> <head><title>this is a title</title></head> <body><h1>Hello world</h1></body>
m.SetBody("text/html", htmlBody)
d := gomail.NewDialer("xxx.xxx.com", 123, "xxx@xx.com", "xxx")
d.TLSConfig = &tls.Config{InsecureSkipVerify: true}
d.DialAndSend(m)
}
`
the email which i received is only the
Hello world
.why the title--this is a title in the html head is ignored.
The text was updated successfully, but these errors were encountered: