If your WordPress site is on cPanel hosting and your mailboxes are at Google Workspace or Microsoft 365, the hosting server probably still believes it is the mail server for your domain. When WordPress hands it a contact-form notification for [email protected], the server tries to deliver it to a mailbox on itself instead of sending it to Google. There is no such mailbox, so depending on how the account is set up the message is rejected with an error, forwarded somewhere nobody looks, or discarded. One reported error is “550 No Such User Here”. Mail from Gmail and other outside senders follows your public DNS to Google, if that is where it points, which is why it arrives.
On cPanel the fix is to make the server’s copy of your MX records name Google (or Microsoft), then set Email > Email Routing to Remote Mail Exchanger, once you have confirmed that no mail for the domain is meant to be delivered on the hosting server.
Why mail from the site and mail from Gmail take different routes
MX records are the DNS entries that tell mail servers where to deliver a domain’s mail. Point them at Google and outside servers deliver to Google. A cPanel server does not always look them up: its mail server, Exim, delivers mail for domains it treats as local on the same machine, and the Email Routing setting decides which domains those are. Under Local Mail Exchanger, cPanel’s documentation says, the server “will always accept mail for the domain”; under Remote Mail Exchanger it “will send all mail for the domain to the lowest-numbered mail exchanger” (
cPanel docs, Email Routing, versions 130 and later).
So the route depends on where a message starts:
| Where the message starts | Route on a typical cPanel server | With routing on Local |
|---|---|---|
WordPress on the same server, default wp_mail() |
The server’s own Exim | Handled locally: bounced, forwarded or discarded |
An SMTP plugin pointed at localhost |
The server’s own Exim | Handled locally |
| Another site or mailbox on the same cPanel server | The server’s own Exim | Handled locally |
| An outside mail server, such as Gmail’s | Public MX | Reaches Google, if public MX points only at Google |
| WordPress through an SMTP plugin set to use a remote service | That service | Delivered by that service, not by the host |
WordPress core’s default is the first row. In WordPress 7.1.4, wp_mail() calls $phpmailer->isMail() (![]()
wp-includes/pluggable.php, tag 7.1.4), which sends through PHP’s mail() function. On Linux, mail() hands the message to the program named in PHP’s sendmail_path setting (
PHP manual, mail configuration), and on a cPanel server that program is normally Exim’s. The host’s configuration decides this; the checks below show which route your server uses.
What happens to the message
A form submission never shows an error on screen. Once the server has decided the domain is local, the domain’s Default Address in cPanel governs mail for addresses that have no mailbox there. Until someone changes it, the Default Address is the account’s default email account. That is a different thing from the system default email address cPanel uses as the sender of script-generated mail. The setting can instead forward such mail elsewhere, reject it during the SMTP conversation, or discard it, and a forwarder for a specific address overrides it (
cPanel docs, Default Address). A server set to reject returns an SMTP error whose code and wording depend on the host; cPanel’s support site has a diagnostic article for reports of “550 No Such User Here” (
cPanel support). Where the bounce, if any, ends up depends on the host’s configuration; Email > Track Delivery, covered below, shows what happened to a given message.
Why “Automatically Detect” picked the wrong answer
Most sites with this problem never chose Local. cPanel’s default, Automatically Detect Configuration, chose it for them. It picks Local when the lowest-numbered MX record points to an IP address on the server, and the documentation is explicit about where it reads that record: “This setting only detects the local zone-file entry and does not perform an actual DNS lookup.”
The local zone file is the DNS data stored on the cPanel server for your domain. Public DNS is whatever your domain’s authoritative nameservers publish, and they need not be the host’s. One way this happens: the site starts on cPanel with a default MX 0 yourdomain.com, DNS later moves to Cloudflare or the registrar, Google’s MX records go in there, and nobody touches the zone on the cPanel server. Public DNS says Google; the server’s zone still names the server, and Automatically Detect reads the server’s zone. The documentation adds that “the system does not automatically change this setting after you update it”, so a manual choice made years ago stays in force too.
When outside senders fail as well
Outside senders reach the host only when public DNS itself still lists it: the host’s nameservers are authoritative, and Google’s MX records were added beside the host’s original record instead of replacing it. If the host’s record has the lower number, outside senders try the host first. If the numbers are equal, RFC 5321 section 5.1 requires senders to “randomize them to spread the load” when there is no reason to prefer one, so a given sender may pick either server (
RFC 5321 §5.1). The cPanel server, still treating the domain as local, rejects the addresses it has no mailbox for. That is the likely reading of the forum post this answer started from (“emails come through, but not all of them”), though only the published records would confirm it.
Why installing an SMTP plugin “fixes” it
The standard forum answer is to install an SMTP plugin, and it often works. When the plugin is set to send through a remote service, such as Google’s SMTP service or a transactional email provider, WordPress hands each message to that service over the network, and the hosting server’s routing setting no longer touches it.
The hosting server is still wrong about the domain. Cron jobs, other sites on the account, and plugins that call PHP mail() directly can still take the local route and still be affected. Routing and authentication are separate problems: the routing setting decides where mail for your domain goes, and sending through an authenticated service decides whether the site’s mail passes SPF (Sender Policy Framework) is a DNS TXT record that lists the servers allowed to send mail using your domain. Receivers compare the sending IP to that list and use the result as one input to their accept/reject decision. Read full reference → and DKIM (DomainKeys Identified Mail) is a cryptographic signature attached to each outgoing message, verifiable against a public key published in DNS. It lets receivers confirm the message was not altered in transit and originated from a server the domain authorised to sign on its behalf. Read full reference → at the receiving end. The Google Workspace SMTP guide covers authentication.
Confirm it before changing anything
None of these checks needs root access.
- Send from the site with any SMTP plugin deactivated. Submit a form, or use the test send in Check & Log Email, to an address at your own domain. This tests default
wp_mail()only when nothing else on the site overrides the mailer. It does not reach Google. - Send to the same address from an outside Gmail account. If public MX points only at Google, it arrives.
- Compare the two sets of MX records. Run
dig MX yourdomain.com +short(or use any web DNS lookup) for what public DNS publishes, and compare it with the MX rows under Domains > Zone Editor > Manage, which show the zone on the cPanel server. Google’s servers in the first and the host in the second is the mismatch. A recently changed record can be served from cache at the old value until its TTL expires. - Read Email > Email Routing. Local Mail Exchanger is consistent with the problem.
- Check Email > Track Delivery, where the host has enabled it. Filter on the recipient address to see the delivery attempt, its route and its result (
cPanel docs, Track Delivery). The SMTP field manual explains how to read the code.
With root on a VPS or dedicated server, grep -H '^yourdomain.com$' /etc/localdomains /etc/remotedomains shows which of cPanel’s two lists the domain is on (the check cPanel’s diagnostic article uses), and exim -bt [email protected] runs Exim’s address-testing mode for that recipient (
Exim specification, command line).
The fix, and when it is wrong
Before changing anything, decide what the domain’s mail design is meant to be. If every mailbox at the domain lives at Google or Microsoft, and no mail for the domain is meant to be delivered on the hosting server, the server should be on Remote.
- Check which nameservers are authoritative:
dig NS yourdomain.com +short, or the nameservers shown at your registrar. - Make the cPanel zone name your mail provider. Under Remote, cPanel sends the domain’s mail to the lowest-numbered MX in the zone stored on the server, so that zone has to hold the right records. In Zone Editor, replace the unintended MX that points at the host with the MX records your provider documents for your domain. If the host manages the zone, ask support to do it. Leave alone any backup MX record that someone set up on purpose.
- Fix public DNS only if it is also wrong. Where the host’s nameservers are authoritative, step 2 is the public change too, and outside senders stop reaching the host once the old record’s TTL expires. Where DNS lives elsewhere, check its MX records there separately.
- Set Email > Email Routing to Remote Mail Exchanger for the domain and click Change. This fixes mail that starts on the server. cPanel does not re-detect the setting by itself after a manual choice, so this choice holds.
Then repeat the test send from the site, and check Track Delivery for the new route.
Two setups change the answer:
- Mailboxes or forwarders that are meant to live on cPanel. If some addresses at the domain are real mailboxes on the hosting server, Remote stops the server accepting mail for the domain, so those addresses stop receiving locally. cPanel forwarders and autoresponders for the domain probably stop processing that mail too. cPanel documents that Remote means the server “will not accept mail for the domain”, but it does not describe their behaviour under Remote directly. A common WordPress case is a cPanel forwarder on
info@that passes form notifications to a personal Gmail. Recreate anything like that with your mail provider, and confirm with the host, before switching. - Email Routing is missing from cPanel. The host can disable the interface in WHM’s Feature Manager. Ask support to check the domain’s routing, and to set it to Remote Mail Exchanger if all of the domain’s mailboxes are hosted elsewhere and no local delivery is intended.
Where to go next
- If notifications still go missing once routing is right, the WordPress email troubleshooting guide walks the rest of the chain from
wp_mail()to the inbox. - To test the server’s mail path with WordPress out of the way, the Swaks guide shows how to send to your own address from the command line.
- When a form reaches one provider but not another, the cause is usually authentication rather than routing; this answer on Gmail versus Office 365 separates the two.
