且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么SMTP通过gmail在本地工作,但不在我的生产服务器上工作?

更新时间:2022-12-15 22:00:11

默认情况下,Gmail会阻止来自AWS的IP地址。
$ b 登录到本地gmail后,请访问以下URL。 / p>

https://accounts.google.com/DisplayUnlockCaptcha



验证您希望您的AWS服务器能够访问您的Gmail帐户后,您的服务器将被列入白名单。


I'm running a nodejs server hosted on AWS (Ireland) and using emailjs to send emails. The email account I'm using is a gmail account and I can send emails from my local machine without any issues, but the emails fail to send from the production server.

Outbound firewall is set to allow all traffic on all ports.

The error message I get is "authorization.failed".

Gmail blocks IP addresses from AWS by default.

After logging into gmail locally, visit the following URL.

https://accounts.google.com/DisplayUnlockCaptcha

Once you verify that you want your AWS server to be able to access your gmail account then your server will be whitelisted.