How to configure Ghost using Mailgun for sending emails (newsletter and membership)
It's not enough anymore to use the default server
NodeMailer to send emails from Ghost. As you can imagine spammers ruined everything. So we need fancy to have DNS records to confirm you are who we say we are.
In short, Ghost needs two elements to send emails correctly:
- 1) API key
- 2) SMTP credentials
In the video, I will teach you how to:
- Create a new domain in Mailgun
- Find your DNS record (TXT, MX, CNAME)
- Configure your DNS record depending on how your domain is managed
- Find your
- Find your
Create your credentials
You must create a Mailgun account.
In the video, you can see how to configure the
API key yourself in the Ghost Admin Panel. That's the easy part.
When FirePress runs your Ghost site, Ghost looks for a configuration file named
config.production.json. This file is not available from the Ghost Admin Panel but only from the actual server. In other words, FirePress manages this for you. Pay attention to lines 14 - 20 - 21 in this screenshot below:
If you choose Option C as detailed here « How can I configure my domain or DNS to FirePress servers » you must send us these
from: Acme Team <[email protected]> host: smtp.mailgun.org user: [email protected] pass: 98rstns9r8tnchangeme8t1ns9r8-aergaer-aergaerg
Can I use my own SMTP server?
The SMTP config settings are for transactional email (signup, signin, staff invite, etc), you can use any mail server for that although a dedicated transactional email service is recommended. But, for the bulk email/member newsletters only Mailgun is supported and is set up with an API key via the admin interface. Source.
v=spf1 TXT record. You might have other email providers like Gmail, Zoho, Protonmail, Sendgrid, etc. using this
v=spf1. They must be all under the same
v=spf1 TXT record. See the video for details.
You cannot have MX from two providers! Unless you already have MX records for pointing to another email provider (e.g. Gmail), you should update the following records.
v=spf1 include:mailgun.org ~all