n8n + MailKite
n8n is an open-source workflow automation platform. Use MailKite as the email layer: send via the SMTP node, receive inbound email via the Webhook trigger, and build email automation flows that connect to anything.
What you need
- A verified domain with SPF + DKIM published
- Your API key (
mk_live_…) - n8n instance (self-hosted or cloud)
Send email via SMTP node
In your n8n workflow, add an SMTP Send node. Configure it with MailKite's connection details:
# n8n SMTP Node settings
Host: smtp.mailkite.dev
Port: 587
User: mailkite
Password: mk_live_...
SSL/TLS: true (STARTTLS)
From: notifications@yourdomain.com
The SMTP node sends plain text or HTML email. Map the To,
Subject, and Text/HTML fields from previous nodes
in your workflow.
Receive inbound email via Webhook trigger
Add a Webhook node as your workflow trigger. Set it to
POST and copy the URL into your MailKite domain's
webhook settings. Every inbound email fires
the workflow with this payload:
from— sender addressto— recipient addresssubject— email subjecttext— plain text bodyhtml— HTML bodyattachments— array of file objects
Example workflow
A common pattern: filter inbound email, process it, and send an auto-reply:
// n8n workflow: Inbound email → Process → Reply
//
// 1. Webhook node (trigger)
// - Method: POST
// - Path: /mailkite-inbound
// - Receives: { from, to, subject, text, html, attachments }
//
// 2. IF node — filter
// - Condition: subject contains "support"
// - True → continue
// - False → Respond (200 OK, skip)
//
// 3. Code node — process
// - Extract ticket info from subject/body
// - Create record in your database
//
// 4. SMTP node — send reply
// - To: {{ $json.from }}
// - Subject: Re: {{ $json.subject }}
// - Text: Thanks for reaching out. We'll get back to you within 24 hours.
//
// 5. Respond to Webhook node
// - Status: 200
// - Body: { "ok": true } Test it
# Trigger the n8n webhook manually
curl -X POST https://your-n8n.example.com/webhook/mailkite-inbound \
-H "Content-Type: application/json" \
-d '{
"from": "customer@example.com",
"to": "support@yourdomain.com",
"subject": "Need help with my order",
"text": "Hi, I placed order #1234 but haven't received it yet."
}' Self-hosted n8n
If you run n8n on your own infrastructure, set the webhook URL to your n8n instance's public URL. MailKite must be able to reach it — use a tunnel (ngrok, Cloudflare Tunnel) if n8n is behind a firewall.
Troubleshooting
- SMTP node timeout — ensure you're on port 587 with TLS. Port 25 is blocked by most networks.
- Webhook not firing — the webhook must be active (toggle it on in n8n). Send a test email after activating.
- Missing fields — n8n's Webhook node returns the full MailKite payload. If a field is missing, check the raw body in the Webhook node's output.
- n8n behind firewall — use
npx localtunnel --port 5678or Cloudflare Tunnel to expose the webhook.
See the SMTP relay docs for connection details, or Inbound webhooks for the full payload.