GuideGhost
Ghost's emails from your own domain.
A self-hosted Ghost site needs a mail service for its own emails: staff invitations, password resets and members' sign-in links. One block in Ghost's config file sends them through MySendbox.
Before you start
- A MySendbox workspace on a plan. Sending by SMTP or the API needs one: see pricing. Each email uses 1 credit.
- Your domain added under Domains, with its DNS records in place and shown as verified. Email can only be sent from an address on a verified domain.
- An SMTP key. In MySendbox, open API keys and choose Create SMTP key. It makes a key that can only send email (the
emails:sendscope). Limit it to your domain, then copy it: it's shown once and starts withmsb_live_.
This is for Ghost you host yourself: the settings go in a config file on your server, as Ghost's configuration docs describe for self-hosted sites.
Add the mail settings
- On your server, open
config.production.jsonin your Ghost folder. - Add this
mailblock next to the other settings (or replace themailblock that's there). Put in your own From address, on your verified domain, and your SMTP key:
config.production.jsonJSON
"mail": {
"from": "noreply@your-domain.com",
"transport": "SMTP",
"options": {
"host": "smtp.mysendbox.com",
"port": 465,
"secure": true,
"auth": {
"user": "mysendbox",
"pass": "msb_live_…"
}
}
}
- Save the file and run
ghost restart.
The file is JSON: the block needs a comma before or after it, between it and its neighbours. Port 465 goes with "secure": true. For port 587, set "secure": false: the connection is still encrypted, it just starts differently (STARTTLS).
Check that it works
- In Ghost, invite a staff member using an email address of yours, or sign out and ask for a password reset.
- The email arrives from your own address.
- In MySendbox, open Emails. The email is listed there with its status.
Good to know
- Newsletters are separate. These settings cover Ghost's own emails. For newsletters to members, Ghost needs a bulk mail service, set up elsewhere: see Ghost's docs. MySendbox SMTP is for one-to-one email, and refuses many identical emails as a broadcast.
- Blocked ports. Some hosts block outgoing mail ports. Ghost's docs name DigitalOcean, which blocks ports 25, 465 and 587 by default. If Ghost can't connect, ask your host.
- The key is in a file. Give Ghost its own key, limited to your domain. If it leaks, roll it under API keys and put the new one in the file.
If an email doesn't send
Ghost's log (ghost log) has the reply from MySendbox:
- “535” or a login error: the username must be
mysendbox, and the password a key that has theemails:sendscope. Ten failed logins in 15 minutes lock the key out for 15 minutes. - “550”: the email was refused, and the message says why. Most often the From address isn't on a verified domain, or the key is limited to another domain.
- “452”: the workspace has no plan, or is out of credits. Start the plan or add credits under Billing.
- A test to
example.comfails: addresses on example domains are never sent to. Use a real inbox of yours.