server send emails using gmail smtp gets alerts

2019-03-11 08:22发布

问题:

I did something like this to make my web app sends mails through gmail's SMTP. I tried locally and it worked. after I upload to the server (which is in another country) I get this error:

authentication failure [SMTP: Invalid response code received from server (code: 534, response: 5.7.9 Please log in with your web browser and then try again. Learn more at 5.7.9 https://support.google.com/mail/bin/answer.py?answer=78754 5.7.9 {WEBLOGINREQUIRED} fl2sm1579003pab.23 - gsmtp)]

is there a way to ignore this?

回答1:

For anyone still interest the answer:

Google have to allow your app to use your own account, to allow this google provided an easy way, just go to https://accounts.google.com/DisplayUnlockCaptcha, then click continue, then with 10 min, use your application to try to send email again, and google will remember the application/service and allow your application to access your account as long as you don't change your password.

cheers



标签: php smtp gmail