Turn incoming emails into webhooks

Trigger your application or workflow the moment an email arrives — no IMAP polling or parsing.

The Problem

  • You need to react when an email arrives but polling is slow and unreliable
  • Parsing MIME messages is painful and breaks across different email clients
  • Attachments come in inconsistent formats and encodings
  • Building email infrastructure distracts from your core product
  • Email forwarding rules lose headers and make automation unreliable

Why Existing Solutions Fall Short

IMAP polling introduces latency and requires managing persistent connections

Regex parsing of email bodies is fragile and constantly breaks

Email forwarding loses important metadata like headers and attachments

Running your own mail server means dealing with spam, security, and deliverability

You shouldn't have to build this yourself.

How Mailhooks Solves This

Real-time Delivery

Webhooks fire instantly when email arrives. No polling delays.

Structured JSON

Every email is parsed into a clean, consistent JSON payload.

Full Headers

Access all email headers for routing, filtering, and automation.

Reliable Attachments

Attachments are extracted and delivered as downloadable URLs.

How It Works

1

Create an inbox

Get a unique email address in seconds.

2

Configure webhook

Point to your endpoint URL.

3

Receive email

Send or forward an email to your inbox.

4

Get webhook

Your endpoint receives structured JSON instantly.

5

Process data

Use the parsed email data in your application.

Code Example

Every email becomes a structured webhook payload you can process.

Webhook Payload

{
  "id": "msg_xyz789",
  "from": "[email protected]",
  "to": "[email protected]",
  "subject": "New order #12345",
  "text": "Order confirmed. Details attached.",
  "html": "

Order confirmed. Details attached.

", "headers": { "message-id": "", "date": "2025-01-15T10:30:00Z" }, "attachments": [ { "filename": "invoice.pdf", "contentType": "application/pdf", "size": 45678, "url": "https://files.mailhooks.dev/..." } ] }

Handler Code

// Handle any incoming email as a webhook
app.post('/webhooks/inbound-email', (req, res) => {
  const { from, subject, text, attachments } = req.body;

  console.log(`Email from ${from}: ${subject}`);

  // Process attachments
  for (const attachment of attachments) {
    console.log(`Attachment: ${attachment.filename}`);
    // Download and process: attachment.url
  }

  // Route based on sender, subject, or content
  if (subject.includes('order')) {
    processOrder(req.body);
  }

  res.status(200).send('OK');
});

Frequently Asked Questions

Every inbox can be configured with sender filtering rules. You can whitelist specific domains or email addresses, or use our webhook to implement your own spam filtering logic. Emails that don't match your rules are automatically rejected.

Webhooks are typically delivered within 100-500ms of email receipt. We process emails in real-time with no polling delays. For high-availability applications, we also offer webhook retries with exponential backoff.

Mailhooks is built specifically for inbound email. We offer simpler setup (no DNS changes required for testing), better attachment handling with direct download URLs, and a developer-first API for fetching emails programmatically—perfect for E2E testing.

Yes! You can connect your own domain with simple DNS configuration. We also provide free subdomains on inbox.mailhooks.dev for testing and development.

We automatically retry failed webhooks with exponential backoff for up to 24 hours. You can also use our API to fetch any missed emails. All emails are stored and accessible via the dashboard.

Get Started in 3 Steps

Takes ~2 minutes — no email infrastructure required.

1

Create a Mailhooks account

Sign up for free in seconds.

2

Create an inbox

Get a unique email address for your use case.

3

Add your webhook URL

Point to your endpoint and start receiving emails.

Start receiving email webhooks in minutes