Guide: troubleshooting
Contact form not sending email? Check these six things.
Usually the form works and the mail provider says no: a revoked API key, a sending domain that is no longer verified, or a sending limit. Many handlers show "Thanks" anyway, because they never read that answer. Log the provider's status code and error name, fix what it names, then check DNS and the spam folder.
- €2 a month per form€1 from the 11th
- 14-day trialCard added at the start
- Ready codeCloudflare Workers, Supabase Edge Functions, Astro sites on Cloudflare, Next.js sites on Vercel or Node.js and plain PHP sites, sending through Resend, and FormHaven forms with no code
- 01Does the handler read the provider's answer?
- 02Find that answer in the logs
- 03Match it to the usual refusals
- 04Check SPF, DKIM and DMARC
- 05Check the spam folder and Resend's status
- 06Run the 5-minute test
Step 1
The handler can say "Thanks" while the send fails
The visitor sees whatever your handler returns. If the code calls the mail provider and then returns a thank-you without reading the answer, a refused send looks exactly like a sent one. Nobody finds out until a client asks why the enquiries stopped.
A common version is on Next.js with Resend's SDK. Resend's docs show a failed call returning { data: null, error: { message, name } }, so a refusal comes back as a value. A try/catch around the call is not enough on its own: check error.
The fix is one if. Read the answer, log the error name, and tell the visitor the truth with a 502 instead of a thank-you.
import { Resend } from "resend";
const resend = new Resend(process.env.RESEND_API_KEY);
export async function POST(request) {
const form = await request.formData();
try {
await resend.emails.send({
from: "Website <form@mail.example.com>",
to: ["you@example.com"],
subject: "New enquiry",
text: String(form.get("message") ?? ""),
});
} catch {
return new Response("Could not send", { status: 502 });
}
// Reached on a refusal too: the SDK put it in `error`, and nobody looked.
return new Response("Thanks!");
}
const { data, error } = await resend.emails.send({
from: "Website <form@mail.example.com>",
to: ["you@example.com"],
subject: "New enquiry",
text: String(form.get("message") ?? ""),
});
if (error) {
console.error("Resend refused the send:", error.name, error.message);
return new Response("Sorry, your message could not be sent.", { status: 502 });
}
console.log("Resend accepted the mail:", data.id);
return new Response("Thanks!");
Step 2
Find the provider's answer in the logs
Two places hold it. Your own logs have it if the handler logs it. Resend's Logs page has it either way.
- Resend. The Logs page lists every API request with its endpoint, status code and full response body. Filter on Errors and look for
POST /emailsat the time of the missing message. - A Cloudflare Worker. Run
npx wrangler tailand send the form: each request and itsconsole.loglines stream to your terminal. The Worker's page in the Cloudflare dashboard shows the same. - Next.js.
console.errorin a route handler goes to the server's output: the terminal runningnext start, or your host's runtime logs.
No request in Resend's Logs means your handler never reached Resend. Then the cause sits in front of the send: the form's action, a bot check refusing everyone, a crash, or a missing environment variable.
HTTP/1.1 403 Forbidden
{
"message": "The example.com domain is not verified. Please, add and verify your domain.",
"name": "validation_error",
"statusCode": 403
}
name tell you what to fix; message says it in words.ExampleStep 3
Match the answer to the usual refusals
These are the answers a contact form handler gets most. The status and name come from Resend's errors reference.
| Resend answered | What happened | Fix |
|---|---|---|
401 validation_error | "API key is invalid": the key does not exist, was deleted or is not active. A deleted key that one deploy still uses looks like this. | Create a key on Resend's API Keys page, update the secret, redeploy. |
401 missing_api_key | The request had no API key: the environment variable is empty in this deploy. | Set the secret in the environment that serves the form. |
403 validation_error | "The domain.com domain is not verified" (with your domain): the from address is on a domain Resend has not verified. | Verify the domain on Resend's Domains page, or send from one that is. |
403 validation_error | "You can only send testing emails to your own email address": the handler still sends from onboarding@resend.dev. | Verify your own domain and change from to an address on it. |
429 daily_quota_exceeded | The plan's daily sending quota is used up. Sent and received emails both count. | Upgrade, or wait for the reset at midnight UTC. |
429 monthly_quota_exceeded | The plan's monthly sending quota is used up. | Upgrade, or turn on pay-as-you-go on a paid plan. |
Every Resend error, its message and its fix
Next.js: three things to check outside Resend
- A variable added or changed on Vercel applies only to new deployments. Redeploy after changing
RESEND_API_KEY. - With
output: "export"the site is static, and a route handler that reads the request is not supported there, so the form has nothing to post to. - A key read as
NEXT_PUBLIC_RESEND_API_KEYis built into the code the browser gets. Keep it server-side, and rotate it if it was ever public.
Step 4
Check SPF, DKIM and DMARC
These three records let the receiving server check that a mail from your domain really came from you. SPF names the servers that may send for the domain, DKIM signs each mail with a key published in DNS, and DMARC tells the receiver what to do when both checks fail.
- Resend gives you the DKIM and SPF records on the domain's Records tab. They must match exactly what Resend generated, so copy and paste them.
- On Cloudflare DNS, set those CNAME records to DNS only (grey cloud). A proxied record stops verification from completing.
- A domain often verifies within 15 minutes of adding the records, and DNS can take up to 72 hours.
- Add a DMARC record once the domain is verified. Resend suggests starting at
p=none.
A record that breaks after verification does not always stop the send. When we replaced a verified domain's DKIM record in a test in November 2026, Resend kept sending, the mail still arrived, and the receiving server recorded dkim=fail. So read the verdict in a mail that arrived: open the raw message (Show original in Gmail) and find the Authentication-Results line.
; DMARC: Resend suggests starting with p=none
_dmarc.example.com TXT "v=DMARC1; p=none; rua=mailto:dmarcreports@example.com;"
; In a mail that arrived, the receiving server's verdict:
Authentication-Results: mx.example.net;
dkim=pass header.d=mail.example.com header.s=resend;
spf=pass smtp.mailfrom=send.mail.example.com;
dmarc=pass header.from=mail.example.com
Step 5
Check the spam folder, then Resend's status for that email
When Resend accepted the mail, its Emails page shows what happened next. The status names are Resend's:
delivered: the recipient's mail server accepted it. From here, look in the spam folder, then at filters and forwarding rules on that mailbox.bounced: the recipient's server rejected it. The address may be wrong or gone.suppressed: Resend did not send it because the address is on its suppression list.delivery_delayed: a temporary problem, such as a full mailbox. Resend retries for up to 14 hours, then marks itbounced.
Forwarding is a frequent catch. Our own support address forwards through Cloudflare Email Routing, and in November 2026 four test mails through it arrived in Gmail's spam folder until a filter told Gmail to never send them to spam.
| You see | Where it went wrong |
|---|---|
| No request in Resend's Logs | Before the send: the form, the route, a bot check or a missing variable. |
| A 4xx in Resend's Logs | Resend refused it. The name says why (step 3). |
bounced or suppressed | The recipient address. |
delivered, nothing in the inbox | The receiving mailbox: spam, a filter, a forward. |
Step 6
Run the 5-minute test
One message through the live form, followed through every place it passes. Do it after every change to the handler, its secrets or its DNS.
- Open the live form (not localhost) and send a message with a word you can search for, such as
test-0923. - Read the handler's log for that request:
npx wrangler tailon a Worker, the server output on Next.js. Note the status and the error name. - Open Resend's Logs and find the
POST /emailsfrom that minute. Check its status and response body. - Open that email on Resend's Emails page and read its status.
- Search the recipient's mailbox for the word, spam folder included.
- Open the raw message and read
Authentication-Resultsforspf=,dkim=anddmarc=.
The first step that fails is where the problem is.
Next time
Hear about the next refusal from us, not from your client
The test above checks one moment. DidMyFormSend keeps checking. After every send, your handler reports what the mail provider answered, and you get an email when the answer is a refusal. Signed tests go into the handler every week once it passes the setup check, and a form that gets fewer messages than the minimum you set is flagged too.
The heartbeat sees the provider's answer to your handler's request. A later bounce or a suppressed address shows on Resend's Emails page. A signed test shows the mail left your handler and reached our mailbox; where your client's own copy lands is outside what the test can see.
Ready code: Cloudflare Workers, Supabase Edge Functions, Astro sites on Cloudflare, Next.js sites on Vercel or Node.js and plain PHP sites. FormHaven forms need no code: paste the monitor's heartbeat key into the form's settings in FormHaven, and FormHaven reports whether each submission's notification emails went out. Signed tests and the test when a form goes quiet do not run on them, because FormHaven has no endpoint that answers our signed test. See the Worker version built step by step, or see how DidMyFormSend works.
- bakery.example / contactSends refused Your form handler tried to email 3 messages, the latest on 22 November at 14:02 UTC, and the mail provider refused them. Resend answered 403.
- example.com / quoteWorking Resend accepted the mail at 14:02 (message id re_8f2c41d9).
Sources and other guides
Every error code, name and message on this page was read on the pages below on 23 November 2026. Providers change their wording, so check the page when something does not match.
- Resend email not sending? Each error, what it means and the fix.
Resend answers every send with an HTTP status and an error name. On a contact form the usual ones are 401 validation_error (the API key is invalid), 403 validation_error (the from domain is not verified, or resend.dev is sending to someone other than you) and 429 (a quota or the rate limit). Log the status and the name, then fix it where the table below says.
- A Cloudflare Worker contact form that sends through Resend
The Worker reads the form post, sends the mail through Resend's API, waits for Resend's answer and tells the visitor what really happened. Keep the API key in a Worker secret, send from a domain you verified in Resend, and hand the report of each send to ctx.waitUntil so it runs after the visitor has their answer.
Hear about the next refused send from us.
Add the heartbeat to your handler and get an email when the provider says no. €2 a month per form, and the first charge comes after 14 days.