'Not able to send email from elastic beanstalk environment through my gmail email id

I'm using Django as the framework, Running inside docker and docker is running on AWS elastic beanstalk docker platform.So, I'm Trying to send email using my Gmail id it works fine in the local environment(in docker).

BUt the same docker image running on elastic beanstalk docker fails to send emails and it is not even giving me an error or something.It is just not sending emails.

If it is working fine in local environment why is that it not sending an email when running in the cloud?



Solution 1:[1]

Without knowing more details, here are a couple of things to check out and remedy if necessary:

  1. Is the Docker container running on an instance in a public subnet? If it's not and it's running in a private subnet, you'll need to setup a NAT instance or gateway and route traffic bound for the internet through that.
  2. Have you got your network security setup correct? Make sure that your Network ACLs and Security Groups will allow the appropriate traffic out to the internet (e.g. 465 or 587 to smtp.gmail.com).

A couple more references that may be helpful:

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/vpc.html http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.managing.vpc.html

Solution 2:[2]

I also had run Spring Boot Application as an Elastic Bean Stalk and received:

Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 554 5.2.0 STOREDRV.Submission.Exception:OutboundSpamException; Failed to process message due to a permanent exception with message WASCL UserAction verdict is not None. Actual verdict is Suspend, ShowTierUpgrade. OutboundSpamException: WASCL UserAction verdict is not None. Actual verdict is Suspend, ShowTierUpgrade. [Hostname=DB7P193MB0300.EURP193.PROD.OUTLOOK.COM]

This message is saying about usages of not verified email addresses, which already verified.

Here is step by step how add email address for senders and recievers and have all them verified or add domain verification if more users from same email are need to be verified.

Please check AWS Docs: Creating an email address identity

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 smcstewart
Solution 2