提交 13d48741 编写于 作者: Mr.奇淼('s avatar Mr.奇淼(

修改email基础配置数据

上级 f3ad4838
......@@ -11,7 +11,7 @@ jwt:
# mysql connect configuration
mysql:
username: root
password: 'root'
password: 'Aa@6447985'
path: '127.0.0.1:3306'
db-name: 'qmPlus'
config: 'charset=utf8mb4&parseTime=True&loc=Local'
......
package utils
import (
"crypto/tls"
"fmt"
"strings"
"net/smtp"
"crypto/tls"
"strings"
"gin-vue-admin/global"
......@@ -31,9 +31,9 @@ func send(to []string, subject string, body string) error {
auth := smtp.PlainAuth("", from, secret, host)
e := email.NewEmail()
if nickName == "" {
if nickName != "" {
e.From = fmt.Sprintf("%s <%s>", nickName, from)
}else{
} else {
e.From = from
}
e.To = to
......@@ -43,8 +43,8 @@ func send(to []string, subject string, body string) error {
hostAddr := fmt.Sprintf("%s:%d", host, port)
if isSSL {
err = e.SendWithTLS(hostAddr, auth, &tls.Config{ServerName: host})
}else{
} else {
err = e.Send(hostAddr, auth)
}
return err
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册