DidMyFormSend

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

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.

app/api/contact/route.js (the bug)
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!");
}
The same send, with the answer read
  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 /emails at the time of the missing message.
  • A Cloudflare Worker. Run npx wrangler tail and send the form: each request and its console.log lines stream to your terminal. The Worker's page in the Cloudflare dashboard shows the same.
  • Next.js. console.error in a route handler goes to the server's output: the terminal running next 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.

What a refusal looks likePOST https://api.resend.com/emails
HTTP/1.1 403 Forbidden

{
  "message": "The example.com domain is not verified. Please, add and verify your domain.",
  "name": "validation_error",
  "statusCode": 403
}
A send from a domain that is not verified. The status and name tell you what to fix; message says it in words.Example

Step 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 answeredWhat happenedFix
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_keyThe 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_exceededThe 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_exceededThe 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_KEY is 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.

DNS and a received mail's verdict (example values)
; 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
Example

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 it bounced.

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 seeWhere it went wrong
No request in Resend's LogsBefore the send: the form, the route, a bot check or a missing variable.
A 4xx in Resend's LogsResend refused it. The name says why (step 3).
bounced or suppressedThe recipient address.
delivered, nothing in the inboxThe 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.

  1. Open the live form (not localhost) and send a message with a word you can search for, such as test-0923.
  2. Read the handler's log for that request: npx wrangler tail on a Worker, the server output on Next.js. Note the status and the error name.
  3. Open Resend's Logs and find the POST /emails from that minute. Check its status and response body.
  4. Open that email on Resend's Emails page and read its status.
  5. Search the recipient's mailbox for the word, spam folder included.
  6. Open the raw message and read Authentication-Results for spf=, dkim= and dmarc=.

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.

MonitorsLast 30 days, UTC
  • 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).
    24 Oct22 Nov
SentRefusedSkippedNo heartbeat Example data

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.

All guides

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.