MIME parsing libraries require deep knowledge of email internals
Base64 decoding and content-type detection is tedious to implement
Self-hosted storage adds infrastructure burden and security concerns
Email forwarding strips or corrupts attachments unpredictably
You shouldn't have to build this yourself.
Attachments are extracted and stored automatically. No parsing required.
Files are stored securely and delivered via signed download URLs.
Get filename, content type, size, and checksum for every attachment.
Clearly distinguish between inline images and file attachments.
User sends an email with attachments to your inbox.
Mailhooks parses and stores all attachments.
Your endpoint receives metadata and download URLs.
Fetch attachments using the signed URLs.
Handle files in your application as needed.
Attachments are extracted and delivered with secure download URLs.
{
"id": "msg_attach789",
"from": "[email protected]",
"to": "[email protected]",
"subject": "Documents for review",
"text": "Please see attached files.",
"attachments": [
{
"filename": "report.pdf",
"contentType": "application/pdf",
"size": 245678,
"checksum": "sha256:abc123...",
"url": "https://files.mailhooks.dev/...",
"inline": false
},
{
"filename": "chart.png",
"contentType": "image/png",
"size": 45678,
"checksum": "sha256:def456...",
"url": "https://files.mailhooks.dev/...",
"inline": true,
"contentId": "chart-001"
}
]
}// Process email attachments
app.post('/webhooks/email', async (req, res) => {
const { from, subject, attachments } = req.body;
for (const attachment of attachments) {
// Skip inline images if needed
if (attachment.inline) continue;
console.log(`Processing: ${attachment.filename}`);
console.log(`Size: ${attachment.size} bytes`);
console.log(`Type: ${attachment.contentType}`);
// Download the attachment
const response = await fetch(attachment.url);
const buffer = await response.arrayBuffer();
// Save to your storage, process, etc.
await saveToS3(attachment.filename, buffer);
}
res.status(200).send('OK');
});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.
Takes ~2 minutes — no email infrastructure required.
Sign up for free in seconds.
Get a unique email address for your use case.
Point to your endpoint and start receiving emails.