Add support for no-auth SMTPs
This commit is contained in:
parent
1064f1e4d8
commit
047de69770
|
@ -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 = ""
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue