Fix mail Chinese subject garbled bug

This commit is contained in:
miraclesu 2016-01-25 22:55:40 +08:00
parent 4de91f675d
commit 5930f27da7
1 changed files with 3 additions and 0 deletions

View File

@ -237,6 +237,9 @@ func (e *Email) Send() error {
if len(e.From) == 0 {
e.From = from.String()
}
// use mail's RFC 5322 to encode any string
sub := mail.Address{e.Subject, ""}
e.Subject = strings.Trim(sub.String(), " <@>")
raw, err := e.Bytes()
if err != nil {