The Contact Form Said Thank You. The Email Never Arrived.
A client doesn't look at Lighthouse. They look at an inbox with no enquiries in it. I've run into that empty inbox three times. Each time the form on the site looked like it worked, and the messages still never reached
A client doesn't look at Lighthouse. They look at an inbox with no enquiries in it.
I've run into that empty inbox three times. Each time the form on the site looked like it worked, and the messages still never reached anyone who would answer them.
Case 1: the former employee's inbox
We took over looking after an online shop, and during the audit I sent a test enquiry through its contact form. The page showed a green thank-you, but nothing arrived.
The form was sending every message to the address it had been set up with, and that address belonged to someone who had left. Nobody read that inbox, and for somewhere between one and three months every enquiry from the site went straight into it.
Case 2: my own form, tested with my own inbox
This one is mine. I built a contact form, tested it with my own email address, saw the messages arrive and handed it over.
At the client, the messages were landing in spam. Their domain had no SPF and no DKIM records, so mail from the site looked like any other unauthenticated mail. My tests passed because the only mailbox I checked was mine.
We found out the hard way. Someone who had written through the form never got a reply, so they contacted the business another way and said so.
Big providers are strict about this now. Since February 2024 Gmail requires every sender to authenticate with SPF or DKIM, and Yahoo asks for the same minimum. DMARC is required on top of that for bulk senders. A contact form isn't bulk mail, but an unauthenticated message from a small domain has little going for it.
There's a related habit of putting the visitor's own address in the From header so the business can just hit reply. The DMARC.org FAQ answers exactly this: you're impersonating the visitor's domain "in a way that is indistinguishable from spammers." Send from an address on your own domain and put the visitor in Reply-To.
Case 3: the honeypot that caught real people
The third one was on a client's site with a honeypot: a text field hidden with CSS that people never see, so any submission that fills it gets treated as a bot and dropped.
Browser autofill was filling it in for real people. It showed up in the log of rejected submissions, with real people's details in it.
Autofill leans heavily on the field's name, and according to web.dev some browsers look at the id too, so a hidden field called email, phone or website is practically asking to be filled. autocomplete="off" is only a hint, too. MDN says it "will not prevent a password manager" from filling a login form, and the Chrome team said back in 2014 it planned to ignore it for address autofill as well. A Rails honeypot gem has an issue where a user suspected Chrome autofill, and it was closed in 2025 with "no stable workaround for all browsers and versions."
If you use a honeypot, give the field a name no autofill would guess and keep it out of the tab order. Keep a log of what it rejects as well, because that's how this one was found.
Where the thank-you comes from
In all three cases the form's job looked done, and nobody checked whether a person ever read the message.
A lot of forms do await fetch(...) and then show the thank-you. A fetch promise doesn't reject on HTTP error statuses, so if the endpoint answers with a 500 and nobody checks response.ok, the visitor still gets thanked. And if the request fails outright, an unhandled rejection means they see nothing at all.
try {
const res = await fetch("/api/contact", { method: "POST", body: new FormData(form) });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
showThankYou();
} catch {
showError("Something went wrong. Please call or email us directly.");
}
On the server, answer 200 only after the mail server has accepted the message, with your own domain in From:
// app/api/contact/route.js (Next.js route handler, nodemailer transporter created elsewhere)
export async function POST(request) {
const form = await request.formData();
try {
await transporter.sendMail({
from: "Website form <[email protected]>",
to: "[email protected]",
replyTo: form.get("email"),
subject: `Enquiry from ${form.get("name")}`,
text: form.get("message"),
});
} catch (err) {
console.error("Contact form mail failed", err);
return Response.json({ ok: false }, { status: 502 });
}
return Response.json({ ok: true });
}
None of that would have saved case 1, though. Code can't tell you that nobody reads the inbox at the other end.
What I check before handing over a form now
- I send test enquiries to several mailboxes at different providers and check where they land.
- I check SPF, DKIM and DMARC on the domain the site sends from before launch.
- The thank-you only shows once the server confirms the message was sent.
Case 1 only came to light because I sent a real test message during the audit and it never arrived.
Has a customer ever been the one to tell you your form was broken?
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.