Before you start
Three things from Hermaily before the first message:
- An account. Create one (there is a free plan). New accounts are reviewed before they can send; you can set everything up in the meantime.
- A verified domain. In Domains, the assistant gives you the DKIM, SPF and DMARC records and checks they are published. You can only send from addresses on that domain or its subdomains.
- An API key for that domain, created in API keys. It starts with
hm_and is shown only once: keep it in your secrets manager or in the environment, never in the repository. The same key is the SMTP password; the username isapikey.
Configuration
In config.production.json, at the root of your Ghost installation:
// config.production.json
"mail": {
"from": "Acme <noreply@acme.example>",
"transport": "SMTP",
"options": {
"host": "smtp.hermaily.com",
"port": 587,
"secure": false,
"auth": {
"user": "apikey",
"pass": "hm_your_api_key"
}
}
}With Docker, the same settings as environment variables (double underscore for each level):
# docker compose: the same settings as environment variables
environment:
mail__from: "Acme <noreply@acme.example>"
mail__transport: SMTP
mail__options__host: smtp.hermaily.com
mail__options__port: 587
mail__options__secure: "false"
mail__options__auth__user: apikey
mail__options__auth__pass: ${HERMAILY_API_KEY}For port 465 use "port": 465 and "secure": true. Every address Ghost sends from must be on your verified domain: mail.from and, for member emails, the support address set in Ghost Admin.
Send a message
Restart Ghost to load the configuration:
ghost restart # Ghost-CLI install
docker compose up -d # Docker: recreates the container with the new variablesThen trigger a real email: invite a staff user from Settings → General → Staff (Invite people), or sign up as a member on your site. The message appears in Hermaily under Messages with its delivery.
Ghost's newsletters do not use this setting: they go through its bulk-email integration, built on Mailgun's recipient variables and events API, which Hermaily does not emulate (it accepts only Mailgun's sending endpoint). Keep newsletters on that integration; Hermaily handles the transactional side.
Events and webhooks
Every message gets an id: over SMTP it comes in the server's reply to the message (250 2.0.0 Ok: queued as <id>). Accepted means queued, not delivered. To know what happened next:
- Dashboard. Messages lists each message with its events: delivered, deferred, bounced, complaint, opened, clicked.
- API.
GET https://api.hermaily.com/v1/messages/{id}returns the current status and every event, oldest first (see looking up a message). - Webhooks. In Webhooks, add your URL (https and public) and the events you want. Hermaily makes one
POSTper event, signed withX-Hermaily-Signature: t=<unix>,v1=<hex>, wherev1isHMAC-SHA256(secret, t + "." + body)over the raw body. Answer any2xxwithin 10 seconds; otherwise it is retried for about a day and a half. Delivery is at least once, so discard duplicates by the eventid. The Test button sends a sample event to check your receiver.
Event types: send, delivery, delivery_delay, bounce, complaint, reject, rendering_failure, open, click and unsubscribe (opens and clicks only with tracking on). Permanent bounces, complaints and unsubscribes are suppressed automatically, so you do not need to keep your own list for that. Payload, fields and signature details are in the webhook documentation.
Troubleshooting
The errors you are most likely to see, with what they mean. The full list is in errors and limits.
Ghost logs Failed to send email
Look at the reason in content/logs/ (or docker logs): it carries Hermaily's SMTP reply. If there is none, the configuration was not loaded: check the JSON syntax and restart Ghost.
535 5.7.8: authentication failed
The password must be the whole API key (hm_...), copied without spaces and not revoked. The username can be anything; use apikey. After many failed attempts from the same IP, logins are refused for a few minutes.
The connection hangs or times out
Your host blocks outgoing SMTP. Try port 465 with implicit TLS instead of 587. If both are closed, your host blocks outgoing SMTP and Ghost has no HTTP transport: ask your provider to open port 587 or 465.
550 5.7.1: the message is refused
The account cannot send right now (pending approval, paused, or new terms to accept), the key is restricted to the other stream, or the From address is not on the key's domain. Over the API this is 403 forbidden.
550 5.6.0: the message is rejected
Usually the From domain is not verified yet, there are more recipients than your plan allows (5 on Free, 50 on paid plans) or the message is too large. Over the API this is 422 validation, with the reason in the message.
Send your first message today
Create the account, verify your domain and paste the key. The free plan is enough to try it.