Why does SMTP via gmail work locally but not on my production server?

3.3k views Asked by At

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".

1

There are 1 answers

3
Daniel On BEST ANSWER

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.