1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-26 04:51:30 +00:00

Fix vet fail

This commit is contained in:
miraclesu 2016-01-26 10:33:48 +08:00
parent 5930f27da7
commit f26d360ec9

View File

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