Receive emails using webhooks. Parse content and attachments. Reply to your users.
Resend started by modernizing the way you send emails.
Today, we're making it easy for you to receive emails as well.
Inbound unlocks entirely new use cases like:
First, determine the email address you want to use. You can either:
<your-alias>@<id>.resend.app)example.com)
Resend processes all incoming emails to the provided address and then:
Here's how to start receiving emails using Resend.
To help you get started quickly, Resend provides a .resend.app address, which is automatically created for you.
To find your Resend domain:
Send emails to your inbound address and Resend will process them and send a JSON payload to your webhook.
Alternatively, for a more branded experience, you can also set up a custom domain to receive emails.
In your application, create a new route that can accept POST requests.
Next, create a new webhook to receive events.
Enter your endpoint URL and select the email.received event.
Once you receive the email event, you can process the email and attachments metadata.
{"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"],"bcc": [],"cc": [],"message_id": "<example+123>","subject": "Sending this example","attachments": [{"id": "2a0c9ce0-3112-4728-976e-47ddcd16a318","filename": "avatar.png","content_type": "image/png","content_disposition": "inline","content_id": "img001"}]}}
All inbound emails are visible on the emails page. Resend will store your emails even if you don't configure a webhook, or if your webhook endpoint is down.
Emails can be filtered by their to, from, and subject fields. Click on an email to see its full details, including the HTML, Plain Text, and any attachments.
Inbound email flows often involve processing attachments.
Users can forward airplane tickets, receipts, and expenses to you. Then, you can extract key information from attachments and use that data.
To do this, call the Attachments API when you receive the webhook event. That API will return a list of attachments with their metadata and a download_url that you can use to download the actual content.
import { Resend } from 'resend';const resend = new Resend('re_xxxxxxxxx');const { data, error } = await resend.emails.receiving.attachments.list({emailId: '4ef9a417-02e9-4d39-ad75-9611e0fcc33c',});
We're excited to see the new features Inbound will empower you to build.
Visit the Inbound API docs to get started.