Skip to main content

Ghost Emails Using Email Hosting

·2 mins

Ghost uses Nodemailer to fling emails around, which means you can use an email hosting solution with Ghost in order to send emails out. The Ghost team have covered self hosted mail configuration, though it might not be obvious what to do if you use a lesser known email hosting solution, or even operate your own. Sergey Cheparev covered this exact problem in their Custom SMTP post. That post should be all you need, but I thought I’d expand on it a bit, and help spread the content.

A Ghost email configuration looks like the below. It’s configured to use encrypted email.

mail: {
    transport: 'SMTP',
    options: {
        host: 'yourdomain.com',
        port: 587,
        secureConnection: true,
        auth: {
            user: '[email protected]',
            pass: 'securePassword1'
        }
    }
}

Breakdown #

  • transport: - The way we’re sending emails.
  • host: - The hostname or IP address to connect to.
  • port: - The port to connect to.
  • secureConnection: - Determines if TLS is enforced.
    • If true, exclusively use TLS.
    • If false, optionally use TLS.
  • user: - The email address you want to send from.
  • pass: - The password for the email address listed in user:.

If you can’t use TLS, you’ll need to set secureConnection to false, and set port to the insecure port provided by your email host.

What are my details #

If you’re unsure what details to put in, your email provider usually has the details listed for you. It might be under a heading like Mail Client Configuration or Manual Settings. They usually look something like this:

Secure SSL/TLS Settings #

Username: [email protected]
Password: The email account password.
Incoming Server: secure.emailhosting.com
IMAP Port: 993
POP3 Port: 995
Outgoing Server: secure.emailhosting.com
SMTP Port: 587

Non-SSL Settings #

Username: [email protected]
Password: The email account password.
Incoming Server: insecure.emailhosting.com
IMAP Port: 143
POP3 Port: 110
Outgoing Server: insecure.emailhosting.com
SMTP Port: 25

Example #

Let’s say your email provider has given you the following details: Username: [email protected]
Password: a%fsd5)0v.
Outgoing Server: secure.fastemailhosting.com
SMTP Port: 587

Then your configuration should look like this:

mail: {
    transport: 'SMTP',
    options: {
        host: 'secure.fastemailhosting.com ',
        port: 587,
        secureConnection: true,
        auth: {
            user: '[email protected]',
            pass: 'a%fsd5)0v.'
        }
    }
}