发送邮件增加ssl功能

This commit is contained in:
bjd
2021-01-22 10:55:49 +08:00
parent 73d1edd62f
commit dd83b330eb
6 changed files with 15 additions and 3 deletions

View File

@@ -68,7 +68,9 @@ func SendMail(subject, to, htmlBody string) error {
server.Port = dataSmtp.Port
server.Username = dataSmtp.Username
server.Password = dataSmtp.Password
// server.Encryption = mail.EncryptionTLS
if dataSmtp.UseSSl {
server.Encryption = mail.EncryptionSSL
}
// Since v2.3.0 you can specified authentication type:
// - PLAIN (default)