feat: now supports custom smtp port

This commit is contained in:
JustSong
2023-05-12 11:44:38 +08:00
parent 9edc54ca69
commit 5c694a1503
9 changed files with 58 additions and 38 deletions

View File

@@ -8,7 +8,7 @@ func SendEmail(subject string, receiver string, content string) error {
m.SetHeader("To", receiver)
m.SetHeader("Subject", subject)
m.SetBody("text/html", content)
d := gomail.NewDialer(SMTPServer, 587, SMTPAccount, SMTPToken)
d := gomail.NewDialer(SMTPServer, SMTPPort, SMTPAccount, SMTPToken)
err := d.DialAndSend(m)
return err
}