Vercel + MailKite
Vercel can receive inbound email via MailKite webhooks. Process email in a Vercel Serverless Function — create support tickets, trigger workflows, or forward notifications.
What you need
- A verified domain with SPF + DKIM published
- Your API key (
mk_live_…) - Vercel project with API routes
How it works
MailKite POSTs inbound email to a Vercel API route. The function processes it and returns 200. Vercel's edge network ensures low latency, and API routes support both Node.js and Edge runtimes.
Set up the webhook
Create an API route at api/mailkite-inbound.js in your Vercel project. This function receives the POST from MailKite and processes the inbound email.
// api/mailkite-inbound.js (Vercel Serverless Function)
export default async function handler(req, res) {
if (req.method !== 'POST') {
return res.status(405).json({ error: 'Method not allowed' });
}
const email = req.body;
console.log(`Inbound: ${email.from} → ${email.to} — ${email.subject}`);
// Process: create a ticket, store in DB, or forward
return res.status(200).json({ ok: true });
} Receive inbound email
Configure your MailKite domain's webhook URL to point at your Vercel API route. Every inbound email delivers this payload:
from— sender addressto— recipient addresssubject— email subjecttext— plain text bodyhtml— HTML bodyattachments— array of file objects
Test it
curl -X POST https://yoursite.vercel.app/api/mailkite-inbound \
-H "Content-Type: application/json" \
-d '{"from":"test@example.com","to":"hello@yourdomain.com","subject":"Hello","text":"Test"}' Troubleshooting
- Vercel serverless functions have a 10-second timeout on Hobby plan; for longer processing, acknowledge the webhook and process async.
- Check function logs in the Vercel dashboard under Deployments → your deployment → Functions.
- Ensure the file is at
api/mailkite-inbound.js— Vercel maps/api/*to theapi/directory.
See the SMTP relay docs for connection details, or Inbound webhooks for the full payload.