/mailgun, ghost, email

Configure Mailgun on self hosted Ghost blog

Mailgun is a fantastic, free service which allows you to send, receive and track email effortlessly. It's dead easy to integrate with your self hosted Ghost blog.

Mailgun configuration

  1. Go to "Domains" section in your Mailgun account.
  2. Click on "Add New Domain" and add a subdomain you want to send emails from.
  3. Follow on page instructions to add all the DNS entries.
  4. Once DNS changes propagate, verify your domain within Mailgun.

Ghost configuration

  1. SSH to your server and edit config.production.json file in the root Ghost directory.
    Your "mail" section should look like this
      "mail": {
        "transport": "SMTP",
        "options": {
          "service": "Mailgun",
          "host": "smtp.eu.mailgun.org",
          "auth": {
            "user": "[email protected]_domain.com",
            "pass": "1234567890"
          }
        }
      }
    
    Notice host entry within options. Official Ghost documentation does not mention that. If your Mailgun domain is set up in the US region, you don't need that line. However if you've set up your domain in the EU region, you'll need to add it in. Otherwise you'll get an error that your username and password were not recognised.
  2. Save changes and restart Ghost.
    ghost restart
    
  3. Log in to your Ghost admin.
  4. Go to "Labs".
  5. Click "Send" in "Test email configuration" section.
    The "Send" button should turn green and you should receive a test email confirming your configuration works.