Skip to main content
Receiving emails are currently in private beta 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 SDK:
npm install resend@6.3.0-canary.1
Join the waitlist if you’re interested in testing this feature.
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 emails using a new custom domain.

1. Add the DNS record

First, verify your domain. Receiving emails 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 Receiving 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 receiving emails without affecting your existing email service. Note that you will not receive emails at Resend if the required MX record is not the lowest priority value for the domain.

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 Receiving 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"
      }
    ]
  }
}

Enabling receiving for an existing domain

If you already have a verified domain, you can enable receiving by using the toggle in the receiving section of the domain details page. Enable Receiving Emails for a verified domain After enabling receiving, you’ll see a modal showing the MX record that you need to add to your DNS provider to start receiving emails. Once you add the MX record, confirm by clicking the “I’ve added the record” button and wait for the receiving record to show as “verified”.

Creating a custom domain for receiving emails using the API

Besides creating a domain in the dashboard, you can also create a domain using the Create Domain API. For that, you must include the capability parameter, which can take send, receive, or send-and-receive as values.
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const domain = await resend.domains.create({
  name: 'inbound.yourdomain.tld',
  capability: 'send-and-receive',
});

FAQ

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.That’s because emails will usually only be delivered to the MX record with the lowest priority value. Therefore, if you add Resend’s MX record to your root domain alongside existing MX records, it will either not receive any emails at all (if the existing MX records have a lower priority), or it will interfere with your existing email service (if Resend’s MX record has a lower priority).
No, you do not need to verify your entire domain again. If you already have a verified domain for sending, you can simply enable receiving for that domain, add the required MX record to your DNS provider, and click “I’ve added the record” to start verifying only the MX record.
I