mirror of
https://github.com/astaxie/beego.git
synced 2024-11-26 04:11:30 +00:00
Fix mail Chinese subject garbled bug
This commit is contained in:
parent
4de91f675d
commit
5930f27da7
@ -237,6 +237,9 @@ func (e *Email) Send() error {
|
|||||||
if len(e.From) == 0 {
|
if len(e.From) == 0 {
|
||||||
e.From = from.String()
|
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()
|
raw, err := e.Bytes()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user