After installing Ghost blog on a Digital Ocean server, I have attempt to invite additional users to be collaborators. It led me to realise Ghost blog email function does not work directly out of the box.

The solution is to integrate an external email service provider like Mailgun.
According to Ghost blog official documentation,

We highly recommend using Mailgun which allows up to 10,000 emails per month for free.

1. Signup for a Mailgun Account

Signup an account at Mailgun. A valid debit/credit card will be required for validation purpose. But we won't be charged unless we go beyond 10,000 emails and 100 validations each month.

2. Create a new domain in Mailgun (mg.domain.com)

Ghost_blog_Mailgun_add_domain

Ghost_blog_Mailgun_fill_domain

3. Update DNS record to verify the domain

i) Add CNAME record

Mailgun Domain Dashboard
Ghost_blog_Mailgun_DNS_CNAME

Digital Ocean DNS
Ghost_blog_Mailgun_DigitalOcean_DNS_CNAME

ii) Add TXT record

Mailgun Domain Dashboard
Ghost_blog_Mailgun_DNS_TXT

Digital Ocean DNS
Ghost_blog_Mailgun_DigitalOcean_DNS_TXT1
Ghost_blog_Mailgun_DigitalOcean_DNS_TXT2

iii) Add MX record

Mailgun Domain Dashboard
Ghost_blog_Mailgun_DNS_MX_record

Digital Ocean DNS
Ghost_blog_Mailgun_DigitalOcean_DNS_MX
Ghost_blog_Mailgun_DigitalOcean_DNS_MX2

Final Result of DNS

Ghost_blog_Mailgun_DigitalOcean_DNS_final

Note that the DNS records may take some time to update. So be patience.

4. Modify config.production.json

SSH into the server and navigate to the directory of ghost installation. Open config.production.json with nano editor.

$ cd /var/www/ghost/
$ sudo nano config.production.json

Identify the mail configuration:

"mail": {
    "transport": "Direct"
},

Change the configuration to specify Mailgun as the email service provider:

"mail": {
    "transport": "SMTP",
    "options": {
        "service": "Mailgun",
        "auth": {
            "user": "postmaster@example.mailgun.org",
            "pass": "1234567890"
        }
    },
    "from": "'Custom Name' <myemail@address.com>"
}

Remember to replace the user and pass with the credentials from Mailgun domain dashboard.

Also, 'Custom Name' and <myemail@address.com> will be shown in the 'from' of the email sent.
Ghost_blog_mailgun_email_from

After edit is done, ctrl + o and ctrl + x to save and exit.

Lastly, restart the Ghost blog for changes to take effect.

$ ghost restart

5. Invite new user to check if the email works

Try inviting people under Ghost admin dashboard team section. Send an invitation to your own email to verify whether the Ghost Blog can send email via Mailgun now.

Conclusion

Hopefully you are able to successfully integrating Mailgun to Ghost blog. 😃
Please let me know how it goes in the comments below. Thank you for reading! 😊

References:

  1. Ghost blog official documentation: Config Mail
  2. Mailgun + DigitalOcean