How incoming emails become HTTP requests your application can process.
Email to webhook is a pattern where inbound emails are converted into HTTP POST requests (webhooks) that your application receives in real-time.
Instead of polling a mailbox or running email infrastructure, you receive a webhook the moment an email arrives — with the message already parsed into structured JSON.
When someone sends an email to your Mailhooks address (e.g., [email protected]), our servers receive it via SMTP.
We handle all the infrastructure: MX records, TLS certificates, spam filtering, and high availability.
The raw MIME message is parsed into a clean, consistent JSON structure. We handle all the complexity: multipart structures, encodings, and client variations.
{
"id": "msg_abc123",
"from": "[email protected]",
"to": "[email protected]",
"subject": "Question about my order",
"text": "Hi, I have a question...",
"html": "<p>Hi, I have a question...</p>",
"headers": { ... },
"attachments": [ ... ]
}Instead of sending base64-encoded files in the webhook payload, attachments are stored and provided as downloadable URLs. This keeps payloads small and predictable.
"attachments": [
{
"filename": "invoice.pdf",
"contentType": "application/pdf",
"size": 45678,
"url": "https://files.mailhooks.dev/..."
}
]An HTTP POST request is sent to your configured endpoint with the JSON payload. Your application processes it like any other webhook.
app.post('/webhook/email', (req, res) => {
const { from, subject, text, attachments } = req.body;
// Process the email
console.log(`Email from ${from}: ${subject}`);
// Download attachments if needed
for (const file of attachments) {
await downloadFile(file.url);
}
res.status(200).send('OK');
});Webhooks fire instantly when email arrives. No polling delays, no checking intervals — immediate notification.
Receive clean JSON instead of raw MIME. No parsing libraries, no encoding edge cases, no multipart handling.
Large files don't bloat your webhook payload. Download attachments when you need them, skip them when you don't.
No mail servers, no persistent connections, no uptime monitoring. Works with serverless functions.
Email to webhook solves the problems with traditional approaches to receiving inbound email:
IMAP polling introduces latency (your polling interval), requires managing persistent connections, and still needs MIME parsing. Webhooks are instant and stateless.
Forwarding emails to another address loses headers, mangles attachments, and still requires you to receive and parse the forwarded message. Webhooks preserve all metadata.
Running email infrastructure requires 4-6 weeks of engineering, ongoing maintenance, spam filtering, and 24/7 uptime. Webhooks let you focus on your application.
Let users respond to notifications from their inbox.
Trigger workflows the moment an email arrives.
Test email flows in Playwright and Cypress.
Use Mailhooks as the email trigger for n8n automations.
Receive inbound email as real-time HTTP webhooks.
Receive and parse inbound email through a REST API.