Receive inbound email in Next.js with a webhook
This guide wires a Next.js App Router route to ReceiveHQ so inbound mail on your domain arrives as JSON. ReceiveHQ posts a Postmark-format body ( application/json ) when the endpoint's payloadFormat is postmark β the default.
1. Create the ReceiveHQ endpoint
Sign up at receivehq.com (magic link).
Create a tenant, add an inbound domain, and point MX at mx.receivehq.com .
Create a webhook endpoint:
HTTPS URL, for example https://yourapp.com/api/inbound
Format: Postmark (JSON) ( payloadFormat id postmark )
Optional Basic auth, configured on the endpoint (console, or basicAuthUser / basicAuthPass on the MCP create_endpoint / create_inbound_domain_endpoint tools). ReceiveHQ then sends Authorization: Basic <base64(user:pass)> on each POST.
Send a test message and inspect the delivery in the console .
2.β¦