you can use a fake webmail for catch your emails from
a smtp docker server. Like mailtrap.io
first of all, you need use the image:eaudeweb/mailtrap
in your docker-compose file.
Then you can config the mapping of ports and the enviroments
variables for access.
As follow:
mail:
container_name: sys_mail
restart: unless-stopped
image: eaudeweb/mailtrap
ports:
- "8125:80"
- "2525:25"
environment:
- MT_USER=mailtrap
- MT_PASSWD=mailtrap
- MT_MAILBOX_LIMIT=512000001
- MT_MESSAGE_LIMIT=102400001
networks:
orion-office-network:
ipv4_address: 172.16.4.3
Very important your address network! because
your enviroment variable for you should be the address of your container address:
this
###> symfony/mailer ###
MAILER_DSN=smtp://172.16.4.3:25?verify_peer=0
###< symfony/mailer ###
you can acces to the admin-panel in :
172.16.4.3:80
user:mailtrap # MT_USER enviroment variables
pass:mailtrap # MT_PASSWD enviroment variables
Other important thing is the ?verify_peer parameter
by default with value true.
if you have problems with the TLS Peers, you can
disabled only for debug . TLS Peer verification
Thanks friends of Eau de web
Top comments (2)
Thanks, Is it works ok with embedded images?
I've used mailhog github.com/mailhog/MailHog and it has problems with that
Of course, but you should have careful with the network because de smtp is inside container