服务器使用 gmail smtp 发送电子邮件获取警报

2022-01-17 00:00:00 smtp gmail php

我做了类似 这个的事情我的网络应用程序通过 gmail 的 SMTP 发送邮件.我在本地尝试过,它奏效了.上传到服务器(位于另一个国家/地区)后,我收到此错误:

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)]

有没有办法忽略这个?

推荐答案

对于仍然感兴趣的人的答案:

For anyone still interest the answer:

Google 必须允许您的应用使用您自己的帐户,要允许这个 google 提供了一个简单的方法,只需转到 https://accounts.google.com/DisplayUnlockCaptcha,然后点击 continue,然后在 10 分钟后,使用您的应用程序再次尝试发送电子邮件,Google 会记住该应用程序/服务并允许您的应用程序只要您不更改密码,就可以访问您的帐户.

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.

干杯

相关文章