Mail Config

A guide to configuring mail for Ghost

Ghost requires a mail configuration in order to send emails to users. This is used for password resets, user invitations, system notifications, and other upcoming features. Ghost uses Nodemailer 0.7 under the hood and will try to use the Direct Mail service if available. Configuring an external mail service will generally be more reliable.

Prerequisites

You should be familiar with Ghost's config setup. If not, please read about it here!

Getting Started

The first thing you're going to need is an account with an email sending service. We highly recommend Mailgun. They have a nice free starter account which allows you to send more email than all but the most prolific email-subscription based blogs could manage. You could also use Gmail or Amazon SES. The full list of supported services can be found in NodeMailer here.

Once you've decided on what email service to use, you need to add your settings to Ghost's config file, depending on the environment you'd like to set it up for.

Mailgun

Head along to mailgun.com and sign up for an account. It's free to use up to 10.000 emails per month. After signing up with Mailgun, verify your email address and log-in to your account. Mailgun allows you to use your own domain for sending transactional emails but if you do not own one it is possible to simply use the handy subdomain that they provide you with (also known as the sandbox domain), although sandbox domains are limited to 300 emails per day. You can change this later, so for now let's use the subdomain automatically generated for you.

Next you're going to need to find your new email service username and password that Mailgun have created for you (they're not the ones you sign up with), by clicking on your sandbox domain on the right hand side. Here is an updated screencast to understand exactly where to find these details:

Mailgun

Mailgun

Now you've got everything you need, it's time to open up your config file. Depending on the environment you want to setup mail for, open your config.production.json or config.development.json file in the editor of your choice, and change your mail settings to look like this:


"mail": {
"transport": "SMTP",
"options": {
"service": "Mailgun",
"auth": {
"user": "postmaster@example.mailgun.org",
"pass": "1234567890"
}
}
}

You can reuse your settings for both your development and production environment if you have both.

When you have finished making changes to you config file don't forget to restart Ghost.

Amazon SES

You can sign up for an Amazon Simple Email Service account over at http://aws.amazon.com/ses/. Once you finish signing up, you'll be given an SMTP user name and password.

Depending on the environment you want to setup mail for, open your config.production.json or config.development.json file in the editor of your choice, and add your Amazon SMTP credentials to your mail settings as shown below:

"mail": {
    "transport": "SMTP",
    "options": {
        "host": "YOUR-SES-SERVER-NAME",
        "port": 465,
        "service": "SES",
        "auth": {
            "user": "YOUR-SES-ACCESS-KEY-ID",
            "pass": "YOUR-SES-SECRET-ACCESS-KEY"
        }
    }
}

Another way to configure mail is using your AWS access keys, like this:

"mail": {
    "transport": "SES",
    "options": {
        "AWSAccessKeyID": "AWSACCESSKEY",
        "AWSSecretKey": "/AWS/SECRET"
    }
}

The first option is safer as stated on AWS Reference guide

When you have finished making changes to chosen config file don't forget to restart Ghost.

From Address

By default the 'from' address for mail sent from Ghost will be set to Blog Title <ghost@your-ghost-blog.com> - where Blog Title is the title you have set in settings, and your-ghost-blog.com is the URL set in your custom config file. If you want to override this to something different, you can also configure it in the config file.

If you only want to override the email address, you can do so with:

"mail": {
    "from": "myemail@address.com",
}

Alternatively you can also provide a custom name:

"mail": {
    "from": "'Custom Name' <myemail@address.com>",
}

When you've finished making changes to your custom config file don't forget to restart Ghost.

Mail Config

A guide to configuring mail for Ghost