Send email from a containerized Ghost blog using SMTP
Sending email from a containerized Ghost blog using SMTP.
It took a little bit of looking to find the answer for this one. Sending email from a Ghost blog looks trivial from their docs - https://ghost.org/docs/config/. But, the configuration changes when running the Ghost as a containerized app.
You will need an email account that can send using SMTP.
I use MXroute as my SMTP service.
The following is added to the 'environment' section of the docker-compose.yml file for your Ghost container to define the mail options:
environment:
# Ghost SMTP configuration
mail__from: 'A Name <user@example.com>'
mail__options__service: SMTP
mail__options__host: 'wednesday.mxroute.com'
mail__options__port: '465'
mail__options__auth__user: 'mail-user@example.com'
mail__options__auth__pass: 'mail-user-password'
docker-compose.yml
I tested this out by sending myself a password reset from the Ghost login page:
![](https://bitbysystems.com/content/images/2023/12/image-2.png)