Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 374
SomethingOn Avatar asked Nov 26 '14 02:11

SomethingOn


People also ask

Why SMTP not working on server?

Check whether there is network access from CSO to the SMTP server. Check whether the firewall is blocking SMTP traffic to SMTP server or whether the ports are blocked. If the server settings and authentication settings are correct, check whether the firewall is blocking port 587 and 465 and SMTP traffic.

Which server does all outgoing email pass through?

Outgoing mail servers are known as SMTP, or Simple Mail Transfer Protocol, servers.

Does Gmail SMTP still work?

Yes! You can. If you're using other email clients, such as Thunderbird or Outlook, you can use the Gmail SMTP server details to still send emails via your Gmail account. However, remember that SMTP is just for sending email.


1 Answers

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.

like image 105
Daniel Avatar answered Oct 04 '22 21:10

Daniel