Drupal SMTP及PHPMailer設定記錄

使用SMTP或PHPMailer模組使,出現驗證過不了,錯誤訊息如下

SMTP -> FROM SERVER: 220 smtp.gmail.com ESMTP a15sm72152275pfj.31 - gsmtp SMTP -> FROM SERVER: 250-smtp.gmail.com at your service, [2400:8500:1301:746:a1xx:130:113:113f] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8 SMTP -> FROM SERVER: 220 2.0.0 Ready to start TLS SMTP -> FROM SERVER: 250-smtp.gmail.com at your service, [2400:8500:1301:746:a1xx:130:113:113f] 250-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8 SMTP -> ERROR: Password not accepted from server: 534-5.7.14 Please log in via your web browser and 534-5.7.14 then try again. 534-5.7.14 Learn more at 534 5.7.14 https://support.google.com/mail/answer/78754 a15sm72152275pfj.31 - gsmtp

解決方式就是開通
https://www.google.com/settings/u/1/security/lesssecureapps




參考來源:
http://stackoverflow.com/questions/21937586/phpmailer-smtp-error-password-command-failed-when-send-mail-from-my-server

PHPMailer下載:
https://github.com/PHPMailer/PHPMailer/tags


不過使用Gmail派信是有限制的,一般的帳戶只能派500封/per day

小型網站,又需要處理寄件問題,可以用這個方案來處理



https://support.google.com/a/answer/166852?hl=en

留言

熱門文章