How to configure Sendmail inside a docker container

0 votes

I have a Docker container running PHP and Apache AWS instance which has the docker instance running. I am not able to send an email from the docker terminal. Is there any way to send an email from docker instance using Sendmail which uses the docker's host's configuration?. 

I am not sure what the error is. 

Apr 10, 2019 in AWS by datageek
• 3,090 points
24,067 views

2 answers to this question.

0 votes

Maybe Sendmail or any other mail service for that matter is installed in your Dockerfile The host, however, apparently does have Sendmail available. The "best" or most Docker-like solution is to spin up another container that runs an MTA and configure your application to use that.

answered Apr 10, 2019 by Archana
• 5,640 points
0 votes

          Here are some reference links which you can refer.

  1. Sending Emails From Docker Containers: http://tdongsi.github.io/blog/2017/05/25/sending-emails-from-docker-containers/
  2. Send mail from Docker container with host's Postfix: https://serverfault.com/questions/631941/send-mail-from-docker-container-with-hosts-postfix
  3. How do you configure Django to send mail through Postfix?: https://www.edureka.co/community/39152/how-do-you-configure-django-to-send-mail-through-postfix
  4. Docker Official Images: https://hub.docker.com/_/postfixadmin
answered Apr 10, 2019 by nmentityvibes
• 420 points
Thank you for the references!

Related Questions In AWS

0 votes
1 answer

How to create a subnet inside a VPC using AWS CLI?

To create a subnet inside a VPC ...READ MORE

answered Feb 21, 2019 in AWS by Priyaj
• 58,020 points
715 views
+1 vote
1 answer

i have configure docker on AWS EC2 instance but commands are not working inside docker container.

Hello @Aniket , The docker exec command runs a new command ...READ MORE

answered Aug 5, 2020 in AWS by Niroj
• 82,840 points
1,698 views
+1 vote
1 answer

How to configure a Lambda function to access resources in a VPC?

Hi@akhtar, You can configure a Lambda function to ...READ MORE

answered Aug 27, 2020 in AWS by MD
• 95,460 points
2,176 views
0 votes
1 answer

How to configure AWS CLI on top of Docker?

Hi@akhtar, The official AWS CLI version 2 Docker ...READ MORE

answered Nov 6, 2020 in AWS by MD
• 95,460 points
1,178 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

AWS ECS Service for Wordpress

If your container needs access to the ...READ MORE

answered Sep 20, 2018 in AWS by Priyaj
• 58,020 points
1,539 views
+1 vote
2 answers

How to read a csv file stored in Amazon S3 using csv.DictReader

The code would be something like this: import ...READ MORE

answered Oct 25, 2018 in AWS by Archana
• 5,640 points
54,421 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP