瀏覽代碼

check for smtp AUTH extension

mcheng89 10 年之前
父節點
當前提交
b9881d1e7b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      modules/mailer/mailer.go

+ 1 - 1
modules/mailer/mailer.go

@@ -82,7 +82,7 @@ func sendMail(hostAddressWithPort string, auth smtp.Auth, from string, recipient
 		return err
 	}
 
-	if auth != nil {
+	if ok, _ := client.Extension("AUTH"); ok && auth != nil {
 		if err = client.Auth(auth); err != nil {
 			return err
 		}