How to Configure Ghost Email with Resend: A Complete Step-by-Step Guide
If you're running a self-hosted Ghost blog and looking for a reliable email provider, Resend is an excellent choice. In this guide, we'll walk through how to set up Ghost to send emails via Resend SMTP, covering everything from domain verification to debugging connection errors.
๐ What is Resend?
Resend is a modern email API service that allows developers to send transactional and marketing emails using a clean and developer-friendly interface. Think of it as a newer, simpler alternative to services like Mailgun, SendGrid, or Postmark.
๐ Why Use Resend with Ghost?
- Fast setup
- Free tier with generous limits
- Clean API and reliable delivery
- Domain verification and link tracking support
- Easy integration with Ghost via SMTP
๐ง Prerequisites
- A self-hosted Ghost blog (Docker or systemd based)
- An account on resend.com
- Access to your domain's DNS provider (e.g., Namecheap, Cloudflare)
- Terminal access to your Ghost instance
๐ Don't Have a Domain Yet?
No worries! If you don't have a domain, you can still test Ghost email functionality using Resend's default sandbox domain, or use their service with a non-verified sender like onboarding@resend.dev.
However, this is only suitable for testing purposes. Most production email clients will mark such emails as spam or reject them due to missing authentication (SPF, DKIM).
๐ Suggested Options:
- Buy a cheap domain from providers like Namecheap or GoDaddy
- Use Resendโs built-in sender
onboarding@resend.devjust for internal tests (not for production) - Test with swaks CLI tool (covered later in this guide)
If you want to buy a domain:
- Visit namecheap.com or google domains
- Register a simple domain (e.g.,
myblogproject.xyz) - Point its DNS to Resend as shown in the next steps
โ Step 1: Add Your Domain to Resend
- Log in to resend.com
- Navigate to Domains and click "Add Domain"
- Enter your domain, e.g.
jameskaranja.me - Resend will provide DNS records to add:
| Type | Name | Value |
|---|---|---|
| TXT | resend._domainkey | DKIM key |
| TXT | @ (root) | v=spf1 include:resend.com ~all |
| CNAME | emails | emails.resend.com (optional for tracking) |
- Add these to your domain's DNS panel (e.g. Namecheap > Advanced DNS)
- Wait for the domain to be verified in the Resend dashboard
๐ ๏ธ Step 2: Configure SMTP in Ghost
Edit your Ghost config.production.json file, usually located at /var/lib/ghost/config.production.json.
Here's a working example:
{
"url": "http://localhost:2368",
"server": {
"port": 2368,
"host": "::"
},
"mail": {
"from": "noreply@jameskaranja.me",
"transport": "SMTP",
"options": {
"host": "smtp.resend.com",
"port": 2587,
"secure": true,
"auth": {
"user": "resend",
"pass": "your-resend-api-key"
}
}
},
"logging": {
"transports": ["file", "stdout"]
},
"process": "systemd",
"paths": {
"contentPath": "/var/lib/ghost/content"
}
}
๐ Note:Use port 2587 with `secure: tree for STARTTLS (as we tested)You can also try port 465 withsecure: true(didn't work for our setup due to ESP limits or network blocks, DIGITAL OCEAN DROPLET)Port 2465 and invalid TLS combos causedESOCKETerrors during testing
๐ Step 3: Restart Ghost
Depending on your environment:
Docker:
docker restart <ghost_container_name>
Systemd:
ghost restart
๐งช Step 4: Test Email Functionality
Try sending an invite or triggering a login link from the Ghost admin panel. If configured correctly, you should receive an email from noreply@yourdomain.com.
๐ Debugging Tips (From Real Experience)
We encountered these issues along the way:
- 500 Error on Login: Caused by SMTP misconfiguration
ESOCKETError: Using wrong port (2465) or mismatchedsecuresetting- Missing
mail.fromWarning: Caused Ghost to fall back to random sender, which Resend rejected - 404 on
.mjs.mapFiles: Harmless static asset 404s in the Ghost admin UI
apt update && apt install swaks -y
๐ก Use swaks to test SMTP manually:
apt update && apt install swaks -y then
swaks --to your@email.com \
--from "noreply@jameskaranja.me" \
--server smtp.resend.com \
--port 2587 \
--auth LOGIN \
--auth-user resend \
--auth-password 'your-resend-api-key' \
--tls \
--header "Subject: Test from Resend" \
--body "It works!"
๐ You're Done!
You've successfully configured Ghost to send email using Resend. Now your login links, staff invites, and member emails will go out reliably from your branded domain.
๐ Bonus SEO Tips
- Add SPF, DKIM, and DMARC records to boost deliverability
- Use a recognizable
fromaddress likenoreply@yourdomain.com - Enable open/click tracking via CNAME in Resend
- Write clean, branded HTML emails for members using Ghost's Email Design settings
๐งต Final Thoughts
Resend makes Ghost email configuration super smooth โ if you know how to set it up right. Now you do! Use this guide as your reference and avoid the trial-and-error we went through. ๐
Let us know if you want to automate this via scripts, or integrate Resend with other apps like Django, Node, or Laravel.
Happy blogging!