summaryrefslogtreecommitdiffstats
path: root/modules/mailer
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-15 14:46:04 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-15 14:46:04 -0400
commit4744996f9a68ef0de8bc87b3c22c0bde9a305847 (patch)
tree3815ebf4cbc7d37b73a892f8797f9357f1011a45 /modules/mailer
parentdb6b71ad03c40e9b01f40bc986a915a8b4bd03b2 (diff)
downloadgitea-4744996f9a68ef0de8bc87b3c22c0bde9a305847.tar.gz
gitea-4744996f9a68ef0de8bc87b3c22c0bde9a305847.zip
Make gmail auth work
Diffstat (limited to 'modules/mailer')
-rw-r--r--modules/mailer/mailer.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go
index 63861d870e..a293beb15b 100644
--- a/modules/mailer/mailer.go
+++ b/modules/mailer/mailer.go
@@ -72,16 +72,14 @@ func Send(msg *Message) (int, error) {
// get message body
content := msg.Content()
- auth := smtp.PlainAuth("", base.MailService.User, base.MailService.Passwd, host[0])
-
if len(msg.To) == 0 {
return 0, fmt.Errorf("empty receive emails")
- }
-
- if len(msg.Body) == 0 {
+ } else if len(msg.Body) == 0 {
return 0, fmt.Errorf("empty email body")
}
+ auth := smtp.PlainAuth("", base.MailService.User, base.MailService.Passwd, host[0])
+
if msg.Massive {
// send mail to multiple emails one by one
num := 0