What is this used for?
It is used for the 'Forgot your password' function, contact forms and anything else you want your web site to email your users about
Why do you have to set up this email functionality?
If you have set up any other CMS before, emailing usually works out of the box so why doesn't Ghost come with this functionality built-in?
Without going into all the technical details let's just say that Ghost just doesn't work that way.
You have to setup a separate SMTP email service. Luckily it's not hard to do.
WHAT TO UNDERSTAND
- The recommended service to use is Mailgun
- This will not be a personal email account for you. Mailgun is not an email provider.
- You do this to enable Ghost to SEND emails to your users
- You can open an account on Mailgun with your personal email address.
- Don't worry, your personal email address will not be used to send emails on Ghost and it will never show up for anyone to see
- Once you have an account you'll set up your MX records for the domain that you host Ghost on.
- You point those MX records to Mailgun
Ok, let's do it
Follow this tutorial that is pretty straight forward
Ghost for Beginners - How to configure ghost to send mail
Once you have a Mailgun account, just follow the easy-to-follow instructions at Mailgun on how to add your domain.
LOCKED OUT - As emailing is a sensitive issue and using Mailgun you could effectively turn into a spammer, Mailgun needs to protect itself. Therefore if their automatic filters detect something suspicious you might be locked out from your Mailgun account.
If that happens, you'll see a red banner at the top of your Mailgun account page that says:
"Your account is temporarily disabled. Business Verification Please contact support to resolve."
DON'T PANIC! - just contact their support and explain what happened
Pay particular attention to:
① When entering a subdomain part (e.g just foo of the foo.myserver.com), DO NOT enter a dot at the end. ② When entering a fully-qualified domain name (e.g. foo.myserver.com), DO add a dot at the end.
Example of BAD DNS setup
Example of GOOD DNS setup
RESTART GHOST - Once you have finished making changes to the Ghost config.js file don’t forget to restart Ghost.
Out of the box, Ghost will actually attempt to use the command line program, Sendmail to send emails.
Some hosting environments will have it installed by default. Digital Oceans Ubuntu Droplet does.
But even if you already have Sendmail installed on your hosting environment, it is still strongly suggested you install a separate smtp email service like Mailgun This is mainly because when you use your hosting environments Sendmail, the email headers will not be formatted properly and that will stop recipients from receiving the emails as they are being marked as SPAM by spam filters.
Example of BAD email headers
Example of GOOD email headers (after Mailgun setup)
Another reason to install a separate SMTP email service is because otherwise you you'll be taxing your servers resources when you send out massive amounts of emails to users. Hence, it is better to use a professional service with a solid infrastructure like Mailgun.