Build email automation in n8n that actually works — MailKite<br>Beta<br>50% off your first year — founding rate for the first 1,000 customers.<br>View pricing →
Sign in · Start free
All posts<br>n8n is the open-source alternative to Zapier. You self-host it, you own the data, and you can build workflows that Zapier can’t — custom code nodes, branching logic, sub-workflows. But n8n’s email nodes have the same problem as every self-hosted tool: the SMTP and IMAP configuration is basic, and the “read email” trigger polls over IMAP.
MailKite fixes both sides. Send email through the SMTP node with DKIM signing and delivery logs. Receive inbound email through a webhook trigger that fires the moment the message arrives — no IMAP polling, no dropped connections, clean JSON.
The problem with n8n’s default email nodes
n8n has two email-related nodes:
SMTP Send — sends email via any SMTP server. Works, but no DKIM signing, no delivery tracking, no retries.
Email Trigger (IMAP) — polls an inbox over IMAP. Checks for new messages every few seconds. Problems: IMAP connections drop silently, Gmail rate-limits polling, Outlook’s IMAP has quirks, and you get raw MIME instead of structured data.
For basic notifications, this works. For production automation — support routing, order processing, lead capture — you need reliability and structure.
The fix: MailKite for both directions
1. Verify your domain in MailKite
Add your domain to the MailKite dashboard. Publish the DNS records (MX, SPF, DKIM, DMARC). Under 5 minutes.
2. Send email: SMTP node
In your n8n workflow, add an SMTP Send node:
SettingValueHostsmtp.mailkite.devPort587UsermailkitePasswordYour API key (mk_live_…)SSL/TLStrue (STARTTLS)Fromnotifications@yourdomain.com<br>Map the To , Subject , and Text/HTML fields from previous nodes. The email is sent through MailKite — DKIM-signed, logged, and trackable.
3. Receive email: Webhook trigger
Replace the IMAP trigger with a Webhook node:
Add a Webhook node as your workflow trigger
Set it to POST
Copy the URL into your MailKite domain’s webhook settings
Activate the workflow
Every inbound email fires the webhook with this payload:
"from": "customer@example.com",<br>"to": "support@yourdomain.com",<br>"subject": "Need help with my order",<br>"text": "Hi, I placed order #1234 but haven't received it yet.",<br>"html": "Hi, I placed order #1234...",<br>"attachments": [<br>"filename": "invoice.pdf",<br>"contentType": "application/pdf",<br>"size": 18213,<br>"url": "https://api.mailkite.dev/att/.../0?sig=..."<br>],<br>"auth": {<br>"spf": "pass",<br>"dkim": "pass",<br>"dmarc": "pass",<br>"spam": "ham"<br>No MIME parsing. No IMAP quirks. Clean, structured data ready for your workflow.
Three workflows that work
Support email → filter → auto-reply
1. Webhook trigger (MailKite inbound)<br>2. IF node: subject contains "support" or "help"<br>3. Code node: extract priority from keywords ("urgent" → high, "asap" → high)<br>4. HTTP Request: create ticket in your system<br>5. SMTP Send: auto-reply to customer<br>"Thanks for reaching out. Ticket #{{ticketId}} created. We'll respond within 24 hours."<br>Lead capture → CRM → Slack alert
1. Webhook trigger (MailKite inbound)<br>2. IF node: from ends with "@potential-client.com"<br>3. HTTP Request: create contact in HubSpot/Salesforce<br>4. Slack node: post to #leads channel<br>"New lead: {{from}} — {{subject}}"<br>Order reply → database → notification
1. Webhook trigger (MailKite inbound)<br>2. IF node: subject matches "Order #\d+"<br>3. Code node: extract order number from subject<br>4. PostgreSQL node: update order status, add customer reply<br>5. SMTP Send: confirm receipt to customer<br>Self-hosted n8n
If you run n8n on your own infrastructure, the webhook URL must be reachable from the internet. If n8n is behind a firewall, use a tunnel:
# Cloudflare Tunnel (recommended)<br>cloudflared tunnel --url http://localhost:5678
# Or ngrok (for testing)<br>npx localtunnel --port 5678<br>Set the tunnel’s public URL as your MailKite webhook. MailKite must be able to POST to it — local-only n8n instances won’t receive inbound email.
How it compares
n8n IMAP triggerMailKite webhook triggerLatency3–15 seconds (polling)Seconds (push)ReliabilityIMAP drops silentlyHTTPS, retried on failureStructureRaw MIME, parse yourselfClean JSON, pre-parsedAttachmentsLimited metadataFilename, size, signed URLAuth resultsNot availableSPF, DKIM, DMARCSendingBasic SMTPSMTP + DKIM signing + logs<br>FAQ
Can I use both MailKite and the IMAP trigger?<br>Yes, but the webhook trigger is faster and more reliable. Use IMAP only if you need to read historical email (MailKite’s webhook only fires for new inbound messages).
Do I need n8n cloud for this?<br>No. Self-hosted n8n works the same way. The only difference: self-hosted instances behind a firewall need a tunnel for MailKite to reach the webhook.
What about n8n’s SMTP Send node limits?<br>n8n’s SMTP node has no built-in rate limiting. MailKite handles rate limiting on the server side — you’ll get a 429 response if you exceed your plan’s limits. For high-volume sending,...