Skip to main content
Inbound emails is currently in private alpha and only available to a limited number of users. APIs might change before GA.To use the methods on this page, you must upgrade your Resend Node SDK to version resend@6.2.0-canary.1 or later.Join the waitlist.
Besides using Resend-managed domains, you can also receive inbound emails using your own custom domain, such as inbound.yourdomain.tld. Here’s how to receive inbound emails using a custom domain.

1. Add the DNS record

First, verify your domain. Inbound requires an extra MX record to work. You’ll need to add this record to your DNS provider.
  1. Go to the Domains page
  2. Copy the MX record
  3. Paste the MX record into your domain’s DNS service
Add DNS records for Inbound Emails
If you already have existing MX records for your domain, we recommend that you create a subdomain (e.g. inbound.yourdomain.tld) and add the MX record there. This way, you can use Resend for inbound emails without affecting your existing email service.

2. Configure webhooks

Next, create a new webhook endpoint to receive email events.
  1. Go to the Webhooks page
  2. Click "Add Webhook"
  3. Enter the URL of your webhook endpoint
  4. Select the event type email.received
  5. Click "Add"
Add Webhook for Inbound Emails

3. Receive email events

In your application, create a new route that can accept POST requests. For example, here's how you can add an API route in a Next.js application:
app/api/events/route.ts
import type { NextRequest } from 'next/server';
import { NextResponse } from 'next/server';

export const POST = async (request: NextRequest) => {
  const event = await request.json();

  if (event.type === 'email.received') {
    return NextResponse.json(event);
  }

  return NextResponse.json({});
};
Once you receive the email event, you can process the email body and attachments. We also recommend implementing webhook request verification to secure your webhook endpoint.
{
  "type": "email.received",
  "created_at": "2024-02-22T23:41:12.126Z",
  "data": {
    "email_id": "56761188-7520-42d8-8898-ff6fc54ce618",
    "created_at": "2024-02-22T23:41:11.894719+00:00",
    "from": "Acme <onboarding@resend.dev>",
    "to": ["delivered@resend.dev"],
    "subject": "Sending this example",
    "attachments": [
      {
        "id": "2a0c9ce0-3112-4728-976e-47ddcd16a318",
        "filename": "avatar.png",
        "content_type": "image/png",
        "content_disposition": "inline",
        "content_id": "img001"
      }
    ]
  }
}
I