Reputation: 91
So I am working on a mailing API for my website. The scenario is as follows:
When I am doing this with my API running on localhost everything works fine and I am receiving email on my mailbox as expected. But when I run my API service on Amazon EC2 instance I am getting this:
Response status code does not indicate success: 404 (Not Found)
I double checked that I have .aws/credentials file both on my localhost machine and EC2 instance (ubuntu 16.10). I can reach my API service running on EC2 instance just fine, because I get the BadRequest response. The problem is when mailing service tries to send an email using amazon SES. I believe it's not the code itself because it runs fine on localhost. Any ideas?
Upvotes: 4
Views: 1850
Reputation: 528
In case someone else has the same problem, changing to port 587 solved the problem.
Ec2 has a very strict throttle on port 25 by default. You can get whitelisted on an IP-by-IP basis by filling out a formal request, but if you're sending to SES, our recommendation is to use port 587 or 2587.
For more on the EC2 throttle on port 25: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-port-25-throttle/
And for more about SES's available SMTP ports: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-connect.html
Upvotes: 5