[fix] fix send email error using outlook smtp

This commit is contained in:
Oswin
2024-07-26 17:47:36 +08:00
parent b8291dcd13
commit da490db6d3
2 changed files with 35 additions and 0 deletions

View File

@@ -62,6 +62,9 @@ func SendEmail(subject string, receiver string, content string) error {
if err != nil {
return err
}
} else if strings.HasSuffix(SMTPAccount, "outlook.com") {
auth = LoginAuth(SMTPAccount, SMTPToken)
err = smtp.SendMail(addr, auth, SMTPAccount, to, mail)
} else {
err = smtp.SendMail(addr, auth, SMTPAccount, to, mail)
}