1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 21:01:31 +00:00

Fix utils mail from field can't including Chinese bug

This commit is contained in:
miraclesu 2016-01-25 18:11:50 +08:00
parent 57d522a96a
commit a80feb00b8

View File

@ -231,11 +231,10 @@ func (e *Email) Send() error {
if e.From == "" || len(to) == 0 {
return errors.New("Must specify at least one From address and one To address")
}
from, err := mail.ParseAddress(e.From)
from, err := mail.ParseAddress(e.Username)
if err != nil {
return err
}
e.From = from.String()
raw, err := e.Bytes()
if err != nil {
return err