|
@ -1,10 +1,10 @@ |
|
|
package utils |
|
|
package utils |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
|
|
|
"crypto/tls" |
|
|
"fmt" |
|
|
"fmt" |
|
|
"strings" |
|
|
|
|
|
"net/smtp" |
|
|
"net/smtp" |
|
|
"crypto/tls" |
|
|
|
|
|
|
|
|
"strings" |
|
|
|
|
|
|
|
|
"gin-vue-admin/global" |
|
|
"gin-vue-admin/global" |
|
|
|
|
|
|
|
@ -31,7 +31,7 @@ func send(to []string, subject string, body string) error { |
|
|
|
|
|
|
|
|
auth := smtp.PlainAuth("", from, secret, host) |
|
|
auth := smtp.PlainAuth("", from, secret, host) |
|
|
e := email.NewEmail() |
|
|
e := email.NewEmail() |
|
|
if nickName == "" { |
|
|
|
|
|
|
|
|
if nickName != "" { |
|
|
e.From = fmt.Sprintf("%s <%s>", nickName, from) |
|
|
e.From = fmt.Sprintf("%s <%s>", nickName, from) |
|
|
} else { |
|
|
} else { |
|
|
e.From = from |
|
|
e.From = from |
|
|