# Resend Send and receive a domain's mail through Resend. ## Prerequisites - A [Resend API key](https://resend.com/api-keys). - A domain on Cloudflare DNS and a [`CF_TOKEN`](deploy-cloudflare.md#1-create-cf_token). - For receiving: `APP_URL` set to a public HTTPS address. ## Set up Follow the [setup steps](providers.md#set-up-a-provider) with the Resend card. One API key serves every domain. Only the primary admin can change it. Mailflare checks it when you save. | Key type | What Mailflare can do | | --- | --- | | Full access | Add the domain, write DNS records, verify, register the webhook | | Sending only | Send. Add the domain and records yourself at [resend.com/domains](https://resend.com/domains), then **Send test email**. | **Sending setup** creates the domain in Resend, publishes DKIM and SPF records and asks Resend to verify. Status can stay `pending` for a few minutes; **Check status** asks again. Replies thread correctly. **Receiving setup** enables receiving, points the apex MX at Resend and registers a webhook at `/api/inbound/resend`. Mailflare verifies it with the secret Resend returns, so it replaces a webhook it did not create. ## Resend-compatible services Set `RESEND_BASE_URL` to the service's API address and use its key. All Resend calls go there. - If it refuses a custom `Message-ID`, set `RESEND_CUSTOM_MESSAGE_ID=false`. Replies then thread on the ID the service reports (`message_id` from `GET /emails/{id}`), or on Mailflare's own if none is reported yet. - If it refuses other headers (such as `Auto-Submitted`), list them in `RESEND_OMIT_HEADERS`, comma-separated. ## Configuration | Variable | Purpose | | --- | --- | | `RESEND_API_KEY` | Resend key | | `RESEND_BASE_URL` | Resend API address (default `https://api.resend.com`) | | `RESEND_CUSTOM_MESSAGE_ID` | `false` stops sending Mailflare's `Message-ID` | | `RESEND_OMIT_HEADERS` | Headers left out of Resend sends | | `APP_URL` | Public HTTPS address for receiving | **Environment variables take precedence over keys saved in the app.** Saved keys are stored as plain text in the database, so protect your backups. ## Clean up Removes the domain from Resend and its DNS records. If the domain still uses Resend one way, only the other capability is switched off. ## Troubleshooting | Problem | Cause | Fix | | --- | --- | --- | | Domain "not verified" | DNS not seen or wrong | [Check records](troubleshooting.md#resend-or-ses-domain-stays-not-verified) | | Domain setup refused | Sending-only key | Use a full-access key | ## Related - [All providers](providers.md)