0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-22 10:14:05 +01:00

Allow send mail without authentication if SMTP server allow this

This commit is contained in:
Alukardd 2014-12-07 16:07:48 +03:00
parent a2f6e1803b
commit 21081836ba

View file

@ -127,7 +127,10 @@ func Send(msg *Message) (int, error) {
return 0, fmt.Errorf("empty email body")
}
auth := smtp.PlainAuth("", setting.MailService.User, setting.MailService.Passwd, host[0])
var auth smtp.Auth
if len(setting.MailService.Passwd) > 0 {
auth = smtp.PlainAuth("", setting.MailService.User, setting.MailService.Passwd, host[0])
}
if msg.Massive {
// send mail to multiple emails one by one