Docs / Ghost

Send email from Ghost over SMTP

A fresh self-hosted Ghost cannot reliably send anything: staff invitations, password resets and the magic links members use to sign in all fail or land in spam until mail is configured. Ghost sends through Nodemailer, so pointing it at Postwing is a few lines in its config file.

⚠
Ghost uses SMTP for one-to-one mail. Newsletters sent to your members go through its bulk email integration, which on self-hosted Ghost supports Mailgun only. No Ghost setting sends newsletters over SMTP.
✓
You can get them on the token management page. For security reasons, a token is shown only once — at the moment it is created.

SMTP connection settings

SettingValue
SMTP hostsmtp.postwing.app
Port587
EncryptionSTARTTLS (the connection is upgraded to TLS before login)
UsernameThe login of an SMTP token for your domain
PasswordThe password of that token — shown once, when the token is created
ℹ
Every mode is also available on a high port: 8465 (SSL/TLS), 8587 (STARTTLS) and 8025 (plain). Many hosting providers and clouds block outbound 25, 465 and 587 — if the connection times out, switch to the matching high port.

Configure config.production.json

Open config.production.json in your Ghost install directory and replace the mail block:

config.production.json
"mail": {
  "transport": "SMTP",
  "from": "'Acme' <noreply@your-domain.com>",
  "options": {
    "host": "smtp.postwing.app",
    "port": 587,
    "secure": false,
    "auth": {
      "user": "token-login@your-domain.com",
      "pass": "your-token-password"
    }
  }
}
KeyValue
transportSMTP
fromAn address on your verified domain, optionally with a display name
options.hostsmtp.postwing.app
options.port587
options.securefalse — STARTTLS is negotiated automatically
options.auth.userThe login of an SMTP token for your domain
options.auth.passThat token's password

For port 465, set secure to true:

json
"options": {
  "host": "smtp.postwing.app",
  "port": 465,
  "secure": true,
  "auth": { "user": "token-login@your-domain.com", "pass": "your-token-password" }
}

Ghost reads its config only at startup, so restart it:

bash
cd /var/www/ghost   # your Ghost install directory
ghost restart

Running Ghost in Docker

Every config key can be set as an environment variable, with nested keys joined by a double underscore:

docker-compose.yml
# docker-compose.yml — Ghost reads nested config from double-underscore variables
services:
  ghost:
    image: ghost:6
    environment:
      url: https://blog.your-domain.com
      mail__transport: SMTP
      mail__from: "'Acme' <noreply@your-domain.com>"
      mail__options__host: smtp.postwing.app
      mail__options__port: 587
      mail__options__auth__user: token-login@your-domain.com
      mail__options__auth__pass: your-token-password

Send a test email

Ghost has no test button. Invite a staff user from Settings → Staff, or sign up as a member on your site through the Portal. If the email does not arrive, ghost log shows the SMTP server's reply.

Troubleshooting

ErrorCause and fix
Failed to send magic link email SMTP rejected or unreachable. Check ghost log for the exact reply.
Changes have no effect Ghost was not restarted, or you edited config.development.json.
Connection timeout Outbound port blocked. Use 8587 with secure: false, or 8465 with secure: true.
TLS handshake errorsecure does not match the port — false for 587, true for 465.
535 authentication failedWrong token login or password.
Mail sent from noreply@ a subdomainmail.from is missing. Set it to an address on your verified domain.
Newsletter will not send Expected — newsletters need the Mailgun integration, not SMTP.

Frequently asked questions

Can Ghost send newsletters over SMTP?

No. SMTP in Ghost is for transactional email only — staff invitations, password resets, member sign-up and sign-in links. Newsletters go through Ghost's bulk email integration, and self-hosted Ghost supports Mailgun only for that. There is no setting that routes newsletters over SMTP.

Where are Ghost's email settings?

In the mail block of config.production.json in your Ghost install directory, not in Ghost Admin. The Email newsletter settings in Admin are for the bulk Mailgun integration and do not affect transactional mail. After editing the file, run ghost restart.

Why does Ghost say 'Failed to send magic link email'?

The member sign-in or sign-up email could not be handed to the SMTP server. Check the mail block for a typo, a wrong port and secure pair, or wrong token credentials, then look at ghost log for the server's actual reply. Ghost does not pick up config changes until it is restarted.

Should secure be true or false for Ghost SMTP?

false with port 587 — the connection starts in plaintext and is upgraded with STARTTLS before the password is sent. true with port 465, where TLS starts immediately. true on 587 or false on 465 fails with a handshake error or a timeout.

Which From address does Ghost use?

The value of mail.from. If it is missing, Ghost falls back to a noreply address on the site's own hostname, which is often a subdomain you never verified for sending. Set mail.from explicitly to an address on your verified domain so DKIM, SPF and DMARC align.

Can I configure SMTP on Ghost(Pro)?

No. Ghost(Pro) runs mail for you and does not expose config.production.json. This guide applies to self-hosted Ghost, whether installed with Ghost-CLI or run in Docker.

Next steps