Send email from a containerized Ghost blog using SMTP

Sending email from a containerized Ghost blog using SMTP.

Send email from a containerized Ghost blog using SMTP
Photo by Siora Photography / Unsplash

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 <[email protected]>'
      mail__options__service: SMTP
      mail__options__host: 'wednesday.mxroute.com'
      mail__options__port: '465'
      mail__options__auth__user: '[email protected]'
      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:

Password reset email from Ghost