|
@@ -2,10 +2,8 @@ package mail
|
|
|
|
|
|
import (
|
|
|
"crypto/tls"
|
|
|
- "fmt"
|
|
|
"github.com/astaxie/beego/logs"
|
|
|
"gopkg.in/gomail.v2"
|
|
|
- "net/url"
|
|
|
settings2 "nginx-ui/server/modules/settings"
|
|
|
"strconv"
|
|
|
"strings"
|
|
@@ -67,7 +65,7 @@ func SendEmail(to string, subject string, body string, sender *Sender) error {
|
|
|
defer closer.Close()
|
|
|
m := gomail.NewMessage()
|
|
|
|
|
|
- from := fmt.Sprintf("%s <%s>", url.QueryEscape(sender.Nickname), sender.Username)
|
|
|
+ from := m.FormatAddress(sender.Username, sender.Nickname)
|
|
|
|
|
|
m.SetHeader("From", from)
|
|
|
m.SetHeader("To", to)
|