Using Postmark as transactional mail service for your self-hosted Ghost CMS
Usually I use Mailgun as a transactional email service, but for a new Ghost site I wanted to try something else. I found out about Postmark and decided to give it a go.
Postmark preparation
- Create a Postmark account
- Add your domain(s) and verify them
- Verify your Postmark account (with the email verification and by requesting manual approval from Postmark)
- Add a server for your Ghost blog
- Click on your server and find the API tokens (username and password are the same token), you'll need them in a minute
Ghost Configuration
- Connect to your server through SSH
- Open up the config file, usually in
/var/www/mywebsite.com/config.production.json
- Add this block and update the credentials:
"mail": {
"from": "Ghost Blog <noreply@mywebsite.com>",
"transport": "SMTP",
"options": {
"host": "smtp.postmarkapp.com",
"port": 587,
"auth": {
"user": "<your-postmark-api-token>",
"pass": "<your-postmark-api-token>"
}
}
},
After that, save the configuration file, run ghost doctor
to confirm that there are no syntax errors and maybe run ghost restart
to be sure.
Now you can test the service by going to the login screen of your Ghost CMS and use the 'forgot password' link to check if you receive the email.