Get your API key
All integrations Hosting

Netlify + MailKite

Netlify can receive inbound email via MailKite webhooks. Process email in a Netlify Function — create support tickets, trigger builds, or forward notifications to your team.

What you need

How it works

MailKite POSTs inbound email to a Netlify Function URL. The function processes it and returns 200. Netlify Functions run on AWS Lambda under the hood, so they scale automatically and require no server management.

Set up the webhook

Create a Netlify Function that receives the POST from MailKite. Place it at netlify/functions/mailkite-inbound.js in your site directory.

netlify/functions/mailkite-inbound.js
// netlify/functions/mailkite-inbound.js
exports.handler = async (event) => {
if (event.httpMethod !== 'POST') {
return { statusCode: 405, body: 'Method not allowed' };
}
const email = JSON.parse(event.body);
console.log(`Inbound: ${email.from}${email.to}${email.subject}`);

// Process: create a support ticket, store in a DB, or forward
return {
statusCode: 200,
headers: { 'Content-Type': 'application/json' },
body: '{"ok":true}',
};
};

Receive inbound email

Configure your MailKite domain's webhook URL to point at your Netlify Function. Every inbound email delivers this payload:

  • from — sender address
  • to — recipient address
  • subject — email subject
  • text — plain text body
  • html — HTML body
  • attachments — array of file objects

Test it

test
curl -X POST https://yoursite.netlify.app/.netlify/functions/mailkite-inbound \
-H "Content-Type: application/json" \
-d '{"from":"test@example.com","to":"hello@yourdomain.com","subject":"Hello","text":"Test"}'

Troubleshooting

  • Netlify Functions have a 10-second timeout on the free plan; for longer processing, acknowledge the webhook and process async.
  • Check function logs in the Netlify dashboard under Functions → your function → Logs.
  • Ensure the function file is at the correct path — Netlify expects netlify/functions/ by default.

See the SMTP relay docs for connection details, or Inbound webhooks for the full payload.