Docker Community Forums

Share and learn in the Docker community.

Unable to send mail from docker container

Hello,

I am unable to send mail from inside docker container.
I run the following commands on terminal:

sendmail start
sendmail: Cannot open mail:25

The error message strongly suggests the sendmail program is unable to reach the host named “mail” on port 25. You may need to expose port 25, and also define the forward and reverse DNS for “mail” within your container/image, in order for that to work.

I cannot get it working too.
Could you provide a working example please?