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"
|
host = "my.smtp.server"
|
||||||
port = "25"
|
port = "25"
|
||||||
|
|
||||||
# cram or plain.
|
# cram | plain | empty for no auth
|
||||||
auth_protocol = "cram"
|
auth_protocol = "cram"
|
||||||
username = "xxxxx"
|
username = "xxxxx"
|
||||||
password = ""
|
password = ""
|
||||||
|
|
|
@ -43,7 +43,7 @@ func NewEmailer(srv ...Server) (Messenger, error) {
|
||||||
var auth smtp.Auth
|
var auth smtp.Auth
|
||||||
if s.AuthProtocol == "cram" {
|
if s.AuthProtocol == "cram" {
|
||||||
auth = smtp.CRAMMD5Auth(s.Username, s.Password)
|
auth = smtp.CRAMMD5Auth(s.Username, s.Password)
|
||||||
} else {
|
} else if s.AuthProtocol == "plain" {
|
||||||
auth = smtp.PlainAuth("", s.Username, s.Password, s.Host)
|
auth = smtp.PlainAuth("", s.Username, s.Password, s.Host)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue