Add support for no-auth SMTPs

This commit is contained in:
Kailash Nadh 2020-02-05 18:09:13 +05:30
parent 1064f1e4d8
commit 047de69770
2 changed files with 2 additions and 2 deletions

View File

@ -79,7 +79,7 @@ max_idle = 10
host = "my.smtp.server"
port = "25"
# cram or plain.
# cram | plain | empty for no auth
auth_protocol = "cram"
username = "xxxxx"
password = ""

View File

@ -43,7 +43,7 @@ func NewEmailer(srv ...Server) (Messenger, error) {
var auth smtp.Auth
if s.AuthProtocol == "cram" {
auth = smtp.CRAMMD5Auth(s.Username, s.Password)
} else {
} else if s.AuthProtocol == "plain" {
auth = smtp.PlainAuth("", s.Username, s.Password, s.Host)
}