Publish with Profit. Transform your Words into

Publish with Profit. Transform your Words into

Create a blog and newsletter to reach a global market and maximize your profits with ghost

Ghost has built-in email features and deep links with Mailgun to help you send the most effective emails (Mailgun sends emails very well).

Most new friends misconfigure Mailgun, resulting in not being able to send emails or being unable to use some features such as tracking and changing email addresses.

There is no complete documentation for you about Mailgun and Ghost, so I will share my experience with you how I configure.

Are Mailgun's DNS settings right?

Although not related to Ghost, creating and adding new domains in Mailgun is "extremely important". Any issues that arise in sending emails are related to DNS and how you add domains.

So, before getting to the other settings, you need to make sure you've done the following steps correctly:

  1. Accounts created over 48 hours (newly created accounts that send bulk emails will be locked or limited to APIs).
  2. Use root domains instead of subdomains (Not good for your brand and bad email addresses, unless you use too many email services to avoid conflicts to use subdmain).
  3. Select the US region (Outgoing emails will be faster).
  4. Don't add Mailgun's MX record in the authentication step (which will cause an error when you change the email address sent in the Ghost dashboard).
  5. Use Cloudflare Nameserver to manage DNS (update DNS records super fast, domain validation will be much faster).
Root Domain and US Region
Root Domain and US Region
Does not validate Mailgun's MX record
Does not validate Mailgun's MX record

Take a close look at each of the above steps, each with its own important reasons.

Important note, when you authenticate open email tracking with DNS on Cloudflare, you must disable Cloudflare proxy to avoid errors (turn off the orange cloud).

Configure email transactions for Ghost

You can use Amazon SES or Mailgun, but it's best to use Mailgun. Why not use Amazon SES? Because:

  1. Amazon SES accounts are difficult to configure, difficult to create, and always have to wait to exit the sandbox for new accounts. Not to mention, you may be denied when your sandbox exit request is invalid by... Amazon approval officers.
  2. It is time-consuming and complicated to add a new domain. It's time-consuming again.

However, if you want to use Amazon SES for a term, refer to the instructions below.

To configure sending email transactions (Staff account initialization verification email, password reset email, successful newsletter registration email, magic login link email), you need to go to the Ghost installation folder.

Find and edit files, addconfig.production.json

"mail": {
  "transport": "SMTP",
  "options": {
    "service": "Mailgun",
    "host": "smtp.mailgun.org",
    "port": 465,
    "secureConnection": true,
    "auth": {
      "user": "admin@yourdomain.com",
      "pass": "xxxxxxxxxxxxxxxxx"
    }
  }
},

Note, always use port 465 instead of port 587 because hosts mostly block port 587.

user and pass you retrieve from creating new SMTP user with Mailgun-level pass
user and pass you retrieve from creating new SMTP user with Mailgun-level pass

Restart the Ghost with the CLI for the configuration to take effect.ghost restart

Newsletter email settings for Ghost

Ghost uses the Mailgun API to send large numbers of emails to your blog subscribers, so you must declare the API key correctly for Ghost to work.

banner-Cuong Thach
Cuong Thach's avatar

Cuong is passionate about digital publishing, specializing in leveraging the power of platforms like Ghost and WordPress, while sharing effective practical SEO writing techniques based on these tools.