WordPress Contact Form Not Sending Email: How to Find Where It Breaks

无评论

Author

Waimaodulizhan Team

Your WordPress contact form shows “thank you”, but the inbox is empty. Did the form actually request an email? The success message comes from the form, not the mail server. Check which step completed before installing another plugin. Otherwise, the change is only a guess.

The transport, the DNS records, and the spam folder are a later branch. They are written up as layers on the page about WordPress not sending email. This page stops at the form. If the form never asked for mail, the mail server is innocent.

Write down what the visitor saw

An error screen and a thank-you screen need different checks. An error means the browser or PHP stopped the form and told the visitor. A thank-you means the form believes it completed; it does not confirm delivery.

Those two outcomes do not share a fix. Screenshot the one you have, including the URL, before you change a setting. A fix you cannot tell from the next bug is not a fix.

Then submit once, yourself, from a browser that is not logged into wp-admin. Caching and security plugins treat a logged-in editor as a different person. The customer’s request is the logged-out one. If only the editor’s browser succeeds, you have reproduced the bug by not reproducing it.

No record of the submission

Find a record of the submission in the plugin’s submission list, mail log or PHP error log. If there is no record, investigate the browser, required fields and captcha before assuming mail was called. The request may have stopped before PHP created the message.

The captcha case we measured was quiet. A reCAPTCHA site key was registered on a different domain. The form stayed broken for 12 days.

207 paid clicks landed on a page that could not send. The way that was found, including why a look at the page source was misleading, is on the invalid-domain site key page. If your key’s domain list does not include the host in the browser bar, stop.

You do not have an email problem yet.

A security plugin may block the admin-ajax or REST request. From the inbox, that looks like any other missing message. The visitor might see an error or a success message from a cached page. Use the log to tell which happened.

No log, no mail. Don’t open an SMTP plugin in this branch.

Contact Form 7 has two different “sent” states

Contact form 7 not sending email is a special case of the same split, because the plugin shows you its own messages. The Mail tab is the message it will try to hand to WordPress. The Messages tab is the sentence the visitor reads.

They are configured separately. A perfect sentence in Messages does not mean the Mail tab has a real recipient.

Check the To address, then the From address. If the server is not authorised to send for the From domain, PHP may accept the message only for it to be dropped later; some hosts reject it immediately.

That later drop is the transport page’s job, once you know PHP was asked. Additional headers copied from a tutorial, especially a CC to an address that does not exist, are enough to make a host refuse the whole message.

Contact Form 7 treats a true return from wp_mail as success and shows the thank-you. wp_mail returning true means the local handoff accepted the message. It does not mean a person saw it.

If you see the red failure instead, wp_mail returned false, and the inbox was never in play. Read the error string. Then decide which branch you are in.

Replacing the form plugin now can remove the error evidence you need. Record it before changing tools.

A log line, and still no inbox

If the submission was stored and the visitor saw a thank-you, the form did its job. The message died in transport, or it was filed as spam, or the To address is a mailbox nobody opens. Those are the layers on the email page: the sending program, the DNS that authorizes it, and the destination folder.

Go there. Don’t rebuild the form.

One check belongs to both pages, so it is here in a single line. The From domain and the site domain should be a pair you chose, not a leftover from the demo. A demo address will not survive a spam filter, and it will not match the DNS you set up for the real name.

After a move, test the form before you test the theme

After a host or domain move, check two common breaks: the captcha key still uses the old domain, or the From address does. The new host may also block direct PHP mail. Test these settings separately.

The site can look finished. The host-move page is the wider list of things that return 200 and do nothing. The form is one of them.

Send the test message in the same hour you change DNS, not in the hour a customer complains.

Cache belongs in that hour too. A page cache that stored the old form markup, or an old nonce, will show a form that cannot submit. Purge it, then submit logged out.

If the form works while you are logged in but fails after logout, investigate caching and rules for anonymous visitors. That symptom does not yet point to SMTP.

Read the Mail tab as a letter, not as a template

Open the Mail tab and read the To, From, subject, and body as if you were the mail server. To should be a mailbox a person opens. From should be an address on a domain you send as.

The body should contain the fields the visitor filled, and the URL of the page they stood on. A body that says only “a message was sent” throws away the lead even when delivery works.

Tags copied from another form are a common break. A body that references a field this form does not have can fail the send, or it can send a letter full of empty brackets. Submit once and read the message you receive.

If a field you filled is missing, the Mail tab is wrong. The Messages tab, where the thank-you lives, will not show you that. The visitor already thinks it worked.

Attachments are a separate gate. A drawing larger than the host will accept never becomes a polite error in the inbox. It fails at the handoff.

If your buyers send files, test with a file of the size they actually send, not with a tiny sample image. When it fails, you still do not know whether the limit is PHP’s upload cap or the mailer’s. The log line tells you whether the form stored the attempt.

A stored lead is not the same as a sent letter

Some form setups write the submission into the database as well as handing it to mail. Check that store before you tell the visitor to try again. A row in the database plus a failed or missing email is a lead you still have. No row means the message never reached the server, and asking them to “check spam” is advice about a letter that does not exist.

If the row exists, reply from it while you fix delivery. The 12 silent days were expensive because nobody had a second copy of those attempts. A store is not a substitute for mail.

It is how you stop losing the ones already sent. Turn it on before you spend an afternoon on DNS records you may not need.

Send the test to a mailbox you do not own

Use a To address on a different domain from the website, one you can open yourself. A test that sends from the server to another mailbox on the same server can succeed while Gmail, or your customer’s host, throws the same message away. One external inbox is enough to see the difference.

Look in that inbox’s spam folder once. If the message is there, delivery worked and the reputation or the content is the problem. That is the transport page, not a new form.

If it is in neither inbox nor spam, it never arrived, and the transport page’s DNS checks are the next hour. You have earned that hour only after this test.

Put the page URL in the test body so a later failure tells you which form it was. A homepage form and a contact-page form are two configurations. Ads often land on one of them.

Fixing the other is a successful test of the wrong page. Submit on the URL the ad uses, logged out, after the cache is purged.

Don’t “fix” a captcha by deleting it on the live site

If the key is registered for the wrong domain, the repair is to add this domain to that key, or to create a key that lists it. Removing the captcha on the production form makes the test pass and leaves the form open to scripts. Do the domain list. The site-key page is the procedure we already documented, including the paid clicks that landed while the key was wrong.

After the key is updated, submit logged out one more time. Cached HTML can still carry the old key. A pass in a private window, with the message visible in the external inbox, is the stop condition.

A green tick inside the captcha widget is not. The widget can look fine while the domain check fails for the visitor.

Why this is worth a line in the monthly note

A form can be silent for days because nothing on the site looks broken. A stretched-out incident is the reason a care routine includes one submission from a stranger’s browser. What else that routine should contain is on the care-plan page.

A visual check of the contact page does not count. The inbox either received the sentence or it did not.

Buying a ranking project for this symptom is the wrong purchase. Google’s note on hiring an SEO says no one can guarantee a number-one ranking, and the useful work it lists is technical advice, content, and measurement. A form that drops paid clicks is a measurement failure you can see this afternoon.

The document is Do you need an SEO? Fix the branch you actually reproduced. The position of the page will not deliver the message the form just swallowed.

Order, written so you can stop early. What did the visitor see. Did the server record the submit.

If it did not, captcha and the browser, not mail. If it did, and Contact Form 7 showed its failure message, read that message before you replace the plugin. If it did, and the thank-you showed, leave the form alone and follow the message into the mail layers.

Stop when the inbox has your test sentence. Not when a new plugin’s settings page looks configured.

Questions when the inbox stays empty

The visitor saw a thank-you. Was the email sent?

Not necessarily. The thank-you is copy stored in the form. wp_mail returning true only means the local handoff accepted the message. Check whether the server recorded the submission.

What did the 12 days and paid clicks refer to?

One form was silently broken for 12 days. 207 paid clicks landed on it. The reCAPTCHA site key was registered on another domain. The write-up of how that was found is on the site-key page.

Should an SMTP plugin be installed first?

No. If nothing logged the submission, mail was never called. Captcha, a blocked request, or a required field is the branch. SMTP is for the branch where a log line exists and the inbox is still empty.

What is specific to Contact Form 7?

The Mail tab and the Messages tab are separate. A polished thank-you does not mean the To address is real. A red failure means wp_mail returned false. Read that message before you replace the plugin.

Related reading: white screen of death diagnosis

Related reading

Frequently Asked Questions (FAQ)

What is the most important technical verification step for WordPress Contact Form Not Sending Email: How to Find Where It Breaks?

Always verify on an uncached cold URL using a real mobile viewport (390px): confirm HTTP 200 status, a single H1 tag, fast Largest Contentful Paint (LCP <= 2.5s), and end-to-end contact form delivery.

How can we get an engineering audit or quote for our B2B WordPress site?

Share your current website URL or project brief via our Contact Us page or WhatsApp (+86 135 2681 6415) to receive an itemized technical scope within 1 business day.

发表评论