WordPress Not Sending Emails: How a Log Full of Successes Hid a Total Delivery Failure
Project overview
Client: A maintenance client, anonymised.
Platform: WordPress on shared hosting, with company mailboxes on Google Workspace.
Problem: The site’s enquiry form stopped sending notification emails. Leads kept saving to the database, so the form itself was working.
Focus: Email deliverability, incident diagnosis, lead capture.
Timeline: Reported before 09:00. Diagnosed, rebuilt and verified by 11:30 the same morning.
This is one of the most common faults we’re called in for, and one of the most misunderstood. A site stops sending email. Somebody checks the logs, finds no errors, and concludes the problem must be somewhere else. It usually isn’t. The silence in the log isn’t a missing error. It’s a false success, and the system is built to produce it.
The challenge
The client got in touch before 9am. Their enquiry form had stopped emailing them. New submissions were still landing in the database, so nothing appeared broken from the outside, but nothing was reaching the team and the client’s own test submission had produced no email at all.
Every enquiry this business receives comes through that form. This wasn’t a cosmetic fault. It was revenue going missing by the hour, and nobody could say when it had started.
The form was working perfectly. That was the problem. Nothing in the system was capable of reporting otherwise.
The investigation
A send log with roughly 1,800 successes and zero failures
The send log reframed the problem within minutes. Across about 1,800 submissions going back months, PHP’s mail() function had returned true every single time. Not one recorded failure anywhere in the history, including the client’s test from that morning.
That’s the whole fault in one observation. mail() doesn’t report delivery. It reports that the local mail server accepted the message for later processing. Everything after that point, routing, authentication, spam filtering, rejection, happens outside your code’s view. The PHP manual is explicit about this: acceptance for delivery does not mean the message will reach its destination.
So a log of 1,800 successes and no failures isn’t evidence that email was working. It’s evidence that nothing was ever in a position to tell you it wasn’t.
Why this affects almost every WordPress site
WordPress routes mail through wp_mail(), and by default that sits on the same transport. WooCommerce order confirmations, Contact Form 7, WPForms, password resets, and nearly every plugin that sends anything all inherit it.
The return value tells you a handoff happened. It cannot tell you a person received something. If your site runs on WordPress defaults, you have exactly the blind spot this client had, whether or not mail is currently arriving.
The mail path crossed a provider boundary
Mapping the route showed why messages were disappearing. The website ran on shared hosting. The company’s mailboxes were on Google Workspace. So every notification was sent as their domain, to their domain, from a machine that wasn’t Google.
That’s a message asking Google to accept mail claiming to be from a domain Google hosts, arriving from somewhere else entirely. Google decides whether to trust it based on the domain’s sender authentication, and this domain’s was permissive and incomplete. SPF and DMARC gave no strong reason to accept anything from that host.
Messages weren’t bouncing in a way anyone could see. They were being quietly deprioritised at the far end of a path the sending code had no visibility into.
Why nobody caught it sooner
The site recorded a delivery status against each lead, which sounds like exactly the safeguard that should have caught this. It was storing the return value of mail().
The field that existed to flag delivery problems could only ever report success. Months of green ticks, generated by a function that was never measuring the thing the field claimed to measure.
The solution
Rather than work out which link in the chain was dropping messages, we removed the chain. If a message never has to cross from the web host into Google, no step in that crossing can lose it.
We rebuilt delivery on authenticated SMTP straight into Google Workspace using PHPMailer, so messages now originate inside the client’s own mail environment and are delivered internally. Google documents the SMTP settings for sending through Workspace, and authenticating as a real mailbox removes the trust question entirely.
Three constraints on how we shipped it
The live form could not break. The new path falls back automatically if credentials are missing, so a half-completed deployment could never take the form offline. On a site where every lead arrives through one form, that mattered more than elegance.
Failures had to become visible. Real SMTP errors are now written to both the log and the lead record. The delivery status field reports what actually happened instead of what was attempted.
A second defect came out with it. Reading the handler, we found a stray send running outside its intended condition on every submission, with malformed headers, carrying internal lead data out to the visitor’s own address. Nobody had reported it, because from the outside it looked like a confirmation email. That’s now removed. If you want the general version of that problem, it’s the kind of thing a proper read of the code surfaces and a plugin scan never will.
Results
The first live submission confirmed the fix twice over. The log showed a clean send with no fallback marker. More usefully, the timestamps showed a two-second gap, which is the round trip of a real SMTP conversation with a real server. The old mail() call returned instantly, every time, which is precisely why it could never tell anyone anything.
Reported before 09:00. Diagnosed, rebuilt and verified by 11:30 the same morning.
Every enquiry from the outage was still sitting in the database. Nothing was lost. It simply never reached a person, and we handed the backlog over for follow-up the same day.
What to check on your own site
Check delivery, not dispatch. If the only evidence that your site’s email works is that no error appeared, you have no evidence. Send a test to an address on a completely different provider and confirm it arrives in the inbox rather than spam.
Treat split hosting as the prime suspect. Website with one provider, mailboxes with another, is the single most common cause of this. The fix is to authenticate to the provider that actually holds the mailboxes, which means an SMTP configuration, not the server default.
Check what your sender authentication actually says. A permissive SPF record and a missing DMARC policy give receiving servers no reason to trust mail sent on your behalf. Google publishes sender requirements that are worth reading even if you only send a handful of transactional messages a day.
If you run WooCommerce, place a real order. Not a plugin’s “send test email” button, which usually exercises a different code path. An actual order, to an address outside your own domain. Silent confirmation email failure is this same fault with a bigger invoice attached, and it’s the first thing we look at in WooCommerce support work and during a store audit.
Audit any field that claims to report status. A status column is only as honest as the value being written into it. This one had been lying for months without anyone doing anything wrong.
Conclusion
The dangerous failures are the quiet ones. No log, alert or dashboard caught this. A customer did, eventually, which is the worst available way to find out.
A system that can only report success is not monitoring. It’s decoration.
This is the same pattern we wrote about when a suspicious file turned out to be harmless: the artifact in front of you can’t answer the question you’re asking, and the answer comes from evidence the system wasn’t recording. It’s also why accumulated technical debt tends to surface as several small unexplained faults rather than one clear break.
Closing that gap is most of what a maintenance relationship is for. Someone who knows the site, notices before the customer does, and can be reached within 30 minutes during business hours instead of being sent a ticket number.
If your WordPress or WooCommerce site sends order confirmations, enquiry notifications, or password resets that you have never actually verified arrive, our WordPress maintenance and WooCommerce care plans cover exactly this kind of monitoring. If you think something is already going missing, tell us what you’re seeing and we’ll take a look.
Related case studies
Elementor Hamburger Menu Not Working: A JavaScript Console Error Case Study
The mobile menu was visible but wouldn't open. It looked like a caching issue, but the browser console revealed a single JavaScript syntax error from an Elementor plugin that was breaking every interactive element on the page. Here's how we traced it, and the safe way to fix it without touching plugin core files.
Read articleWordPress Site Loading Without CSS, JavaScript, or Images: A File Permission Fix
A WordPress site was loading as mostly unformatted HTML: layout gone, images broken, navigation reduced to plain links. Its pages, database and admin area were still running. The cause was not malware or a failed update. It was one directory permission on wp-content.
Read articleRestoring a Legacy WordPress Website After PHP Compatibility Errors
A legacy WordPress site built with an older theme, bundled shortcodes, dated builder components and outdated plugins started breaking after a PHP update. We restored admin access, resolved the critical fatal errors, handled plugin and builder conflicts, and recovered the broken promo box shortcode section while preserving the existing design.
Read article