How to Fix Contact Form 7 Not Sending Emails (Step-by-Step Diagnosis)
Contact Form 7 emails not arriving? Use the red, orange or green message to find the cause, then fix From/Reply-To, spam blocks, SPF/DKIM and SMTP.
People are filling in the contact form on your website, but the emails never arrive. You might be losing real enquiries and not even know it.
This guide helps you find out why, and fix it, without guessing.
The first clue is the colour of the message that appears under the form after you send a test:
- A red border means WordPress tried to send the email and failed.
- An orange border means the message was treated as spam, so no email went out.
- A green "Thank you for your message. It has been sent." means WordPress handed the email on, and it went missing later — often in a spam folder, or because the From address isn’t right.
In this guide you’ll learn:
- How to read that colour and know which problem you have, before you change anything.
- How to set the From and Reply-To addresses the right way. From should be an address on your own domain (your website’s name). The visitor’s address goes in Reply-To, so you can still reply to them.
- How to send mail through a trusted mail service. That’s called SMTP: a proper way to deliver email, instead of letting your website send it on its own.
You don’t need to write code. A few optional steps are clearly marked, and you can skip them. By the end, you should be able to submit a test and see the email arrive.
Who this guide is for
- Small business owners and freelancers whose website enquiries have stopped arriving.
- Website managers who’ve installed Contact Form 7 and need it to work reliably.
- Anyone who has seen "There was an error trying to send your message. Please try again later." on their own form.
You don’t need to write code. A few optional steps involve editing wp-config.php or adding a small plugin file. Those are labelled clearly and can be skipped.
What you need before you start
- Administrator access to your WordPress dashboard.
- A mailbox you can check (and its spam folder).
- An email address on your website’s domain, for example
wordpress@yourdomain.comorhello@yourdomain.com. If you don’t have one, create it in your hosting or email provider’s control panel. - Optional: access to your domain’s DNS settings (for SPF and DKIM), and file access to your site (SFTP or your host’s file manager) for the debug-log steps.
- A recent backup of your site before you install plugins or edit files.
Contents
- Submit a test and read the response colour
- Fix the Mail tab settings (From, To and Reply-To)
- Clear any configuration errors Contact Form 7 reports
- Save every submission with Flamingo so leads aren’t lost
- If you see a red border: find out why wp_mail() failed
- If you see an orange border: find out why it was marked as spam
- If you see green but no email arrives: fix delivery
- Send mail through SMTP (the long-term fix)
- Common errors and what they mean
- Troubleshooting checklist
- Alternatives and limitations
- FAQ
Step 1: Submit a test and read the response colour
- Open the page with your form in a private or incognito browser window, so you see what a visitor sees.
- Fill in the form with a real email address you can check, and submit it.
- Note the response message and the colour of its border.
| What you see | What Contact Form 7 is telling you | Go to |
|---|---|---|
| Green border: "Thank you for your message. It has been sent." | wp_mail() completed successfully. The email left WordPress but didn’t reach the inbox. |
Step 7 |
| Red border: "There was an error trying to send your message." | Contact Form 7 called wp_mail() and it failed. |
Step 5 |
| Orange border with the same error text | A spam-protection module (Akismet, reCAPTCHA or the disallowed list) blocked the submission. | Step 6 |
| Spinner keeps turning, nothing happens | Usually a JavaScript or plugin/theme conflict, not an email problem. | Troubleshooting checklist |
Page reloads and the URL ends in something like #wpcf7-f123-o1 |
The form is running without AJAX, usually because its JavaScript isn’t loading. | Troubleshooting checklist |
These meanings come from the Contact Form 7 FAQ. The plugin deliberately shows the same text for mail failures and spam so that spammers aren’t told they were detected, which is why you need the border colour to tell them apart.
Whatever colour you see, complete Steps 2 to 4 next. They fix the most common causes and protect your enquiries while you troubleshoot.
Step 2: Fix the Mail tab settings (From, To and Reply-To)
In WordPress, go to Contact → Contact Forms, open your form and click the Mail tab.
-
To: the mailbox that should receive enquiries, for example
you@yourdomain.com. It must use valid mailbox syntax, or Contact Form 7 reports a configuration error. -
From: an address on your website’s domain, with a sender name. For example:
Your Business Name <wordpress@yourdomain.com>Contact Form 7’s documentation says the From address should belong to the same domain as the site. If you put a visitor’s address here, or a Gmail or Yahoo address, the email claims to come from a domain your server isn’t allowed to send for, and receiving servers are likely to treat it as spoofed. Setting a name before the address also replaces the default "WordPress" sender name.
-
Subject: anything that helps you spot enquiries, for example:
[_site_title] enquiry: [your-subject][_site_title]is one of Contact Form 7’s built-in special mail-tags. -
Additional headers: add this line so that clicking Reply goes to the visitor:
Reply-To: [your-email]Replace
your-emailwith the name of the email field in your form if you’ve changed it. -
Message body: check that every mail-tag matches a field in the Form tab. A tag like
[your-phone]with no matching form field is sent as literal text. Don’t leave the body empty or very short. Contact Form 7’s best-practice guide warns that this can look like spam and makes sending fail on some hosts. -
Click Save.
Make sure the From mailbox actually exists. Contact Form 7 recommends creating a real wordpress@yourdomain.com mailbox, because its default template uses that address and some hosts block outgoing mail from addresses that don’t exist.
Note
Watch out: in one WordPress.org support thread, an SMTP plugin’s support team found that lines in the message body starting with header words like
From:orSubject:could be read as duplicate headers by some receiving servers. If your template has lines likeFrom: [your-name], consider relabelling them, for exampleSender name: [your-name]. This comes from a support forum, not Contact Form 7’s documentation, so treat it as a tip rather than a rule.
Step 3: Clear any configuration errors Contact Form 7 reports
Contact Form 7 has a built-in configuration validator that checks your form every time you save it. Errors appear as warnings in the form editor. Only logged-in users who can edit forms see them.
Mail-tab errors you might see include:
- Invalid mailbox syntax is used.
- Sender email address does not belong to the site domain.
- There are invalid mail header fields.
- There is a possible empty field.
- Attachment file does not exist.
- Unsafe email config is used without sufficient protection.
Fix each warning, save again, and confirm the warnings are gone. The validator only checks syntax. It doesn’t send a test email, so a clean result doesn’t prove delivery works. You can disable it, but the documentation recommends keeping it on.
Step 4: Save every submission with Flamingo so leads aren’t lost
Contact Form 7 doesn’t store submitted messages anywhere. If email fails, the message is gone. Flamingo is a free plugin from the same author that saves submissions to your WordPress database.
-
Go to Plugins → Add New, search for Flamingo, then install and activate it.
-
Submit another test. You’ll find it under Flamingo → Inbound Messages.
-
If your form doesn’t use the default field names (
your-name,your-email,your-subject), open the form’s Additional Settings tab and map them:flamingo_email: "[the-email-field]" flamingo_name: "[the-name-field]" flamingo_subject: "[the-subject-field]"
Flamingo also helps with diagnosis. Submissions blocked as spam go to its Spam folder with a spam log explaining which module blocked them. Spam logging needs Contact Form 7 5.1.2+ and Flamingo 2.0+.
Flamingo stores personal data (names, emails, messages) in your database. Mention this in your privacy policy, and delete old messages you no longer need.
Step 5: If you see a red border, find out why wp_mail() failed
A red border means the sending function itself returned an error. Common causes are an invalid mail setup, a host that blocks or limits PHP mail, or a mail server that is down. To find the actual reason:
Option A: Use a mail-logging plugin (no code)
Install a free plugin that records outgoing emails and their errors, for example WP Mail Logging, or FluentSMTP, whose free version includes email logs. Submit the form again and open the log entry. It shows the error message WordPress received.
Note: in WP Mail SMTP, email logging is listed as a Pro feature on its WordPress.org page, so its free version won’t give you a log.
Option B: Write failures to the WordPress debug log (advanced)
WordPress fires the wp_mail_failed action whenever its mailer (PHPMailer) throws an error. You can write those errors to wp-content/debug.log:
-
In
wp-config.php, above the line that says/* That's all, stop editing! */, add:define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false ); @ini_set( 'display_errors', 0 ); -
Create the file
wp-content/mu-plugins/log-mail-failures.php(create themu-pluginsfolder if it doesn’t exist) with:<?php /** * Plugin Name: Log wp_mail failures * Description: Writes wp_mail() errors to the PHP error log (wp-content/debug.log when WP_DEBUG_LOG is on). */ add_action( 'wp_mail_failed', function ( $error ) { error_log( 'wp_mail_failed: ' . $error->get_error_message() ); } ); -
Submit the form, then open
wp-content/debug.logand search forwp_mail_failed. -
When you’ve finished, set
WP_DEBUGback tofalseand delete the mu-plugin file. Debug logs can contain personal data and shouldn’t be left running on a live site.
Status: the hook and constants are taken from the WordPress developer documentation. This snippet is written from the WordPress hook documentation. Test it on a staging site first, and back up before you add it to a live site.
What to do with the error
SMTP Error: Could not authenticate.The username, password, app password or API credentials in your SMTP plugin are wrong or have been revoked. Re-check the details your email provider gives you (Step 8).SMTP Error: Could not connect to SMTP host.Wrong host, port or encryption setting, or your web host blocks outgoing SMTP on that port. Check your provider’s documented port and TLS setting, and ask your host whether the port is open.Could not instantiate mail function.You’re not using SMTP, and your server’s PHP mail function isn’t working or is disabled. Ask your host, or switch to SMTP.
(These three messages are PHPMailer’s own English error strings, the library WordPress uses to send mail. Plugins may wrap them in extra text.)
- Invalid address errors: go back to Step 2 and check the To, From and header syntax.
If you can’t read the error or it points to the server, contact your host with the exact message and the time of the test. Contact Form 7’s FAQ also recommends this, because hosts can check server-side mail logs that you can’t.
Step 6: If you see an orange border, find out why it was marked as spam
- With Flamingo installed (Step 4), open Flamingo → Inbound Messages → Spam, open the blocked test and read the spam log.
- Then, depending on the reason:
- reCAPTCHA: Contact Form 7 (5.1 and later) uses reCAPTCHA v3. Keys created for v2 don’t work with v3, and the site’s domain must be registered in the reCAPTCHA Admin Console. Check the keys under Contact → Integration.
- Akismet: test with realistic content. Very short test messages or links can look spammy.
- Disallowed list: check Settings → Discussion → Disallowed Comment Keys. Contact Form 7 treats any message containing a word on that list, or sent from an IP address on it, as spam. Remove entries that are too broad. To see a sender’s IP in your emails, add the
[_remote_ip]mail-tag.
- Submit again and confirm the border is now green.
Step 7: If you see green but no email arrives, fix delivery
Green means wp_mail() returned success. The WordPress documentation is explicit that a successful return "does not automatically mean that the user received the email". The email was lost or filtered after leaving your site.
- Check spam, junk, promotions and quarantine folders, including any admin quarantine if you use Google Workspace or Microsoft 365.
- Try a second recipient on a different provider (for example a Gmail and an Outlook address). If one receives it and the other doesn’t, it’s a reputation or authentication problem, not a form problem.
- Confirm Step 2: From on your domain, visitor in Reply-To.
- Check your domain’s email authentication. Google’s sender guidelines require everyone sending to personal Gmail accounts to set up SPF or DKIM for the sending domain. Senders of more than 5,000 messages a day to Gmail also need DMARC. If your domain’s SPF record doesn’t include the server or service that actually sends your website’s mail, Gmail and other providers may reject it or file it as spam.
- Your email or SMTP provider supplies the exact SPF include and DKIM records to add. Copy them from their documentation into your DNS. Don’t guess the values.
- For a fuller walkthrough of SPF, DKIM and DMARC, see our guide to why WordPress emails go to spam in Gmail.
- A domain can have only one SPF record (RFC 7208). If one already exists, add the new
include:to it rather than creating a second record.
- Read the headers of a delivered test (if one landed in spam). In Gmail, open the message, choose Show original, and check whether SPF, DKIM and DMARC show PASS.
- If your host’s PHP mail has a poor reputation, or you can’t add DNS records for it, move to SMTP (Step 8).
Step 8: Send mail through SMTP (the long-term fix)
By default, WordPress sends mail through your web server. An SMTP plugin routes every wp_mail() call, including Contact Form 7’s, through an authenticated mail service instead. That service can be your business mailbox provider or a transactional email service.
Free plugins on WordPress.org that do this include:
| Plugin | Free email log? | Notes (from its WordPress.org page, 12 Nov 2026) |
|---|---|---|
| FluentSMTP 2.4.5 | Yes | Many providers, test email from settings, failure alerts, WP-CLI test command |
| WP Mail SMTP 4.10.4 | No (Pro feature) | Setup wizard, many mailers, test email |
| Post SMTP 4.0.2 | Yes (per its listing) | Email log and alerts listed as features |
General setup (exact screens differ by plugin and provider):
- Choose where mail will be sent from: your domain’s mailbox provider (for example Google Workspace or Microsoft 365) or a transactional email service.
- Follow that provider’s guide to get the SMTP host, port, encryption (TLS) and credentials, or the API key for an API-based mailer.
- Add the DNS records (SPF include, DKIM) the provider gives you, so your domain authorises it.
- In the plugin, set the From email to the same domain address you used in Step 2. Some SMTP plugins (FluentSMTP, for example) can force this From address for all site mail, so other plugins can’t override it.
- Send the plugin’s test email, then submit your Contact Form 7 test again.
Use a dedicated sending address or an app-specific credential where your provider supports it, and never paste your main account password into a plugin you don’t trust. Some providers’ free tiers have daily sending limits. Check the provider’s current pricing page.
Common errors and what they mean
"There was an error trying to send your message. Please try again later." (red border)
wp_mail() failed. See Step 5.
Same message with an orange border
A spam module blocked it. See Step 6.
"Thank you for your message. It has been sent." but nothing arrives
Delivery or filtering problem. See Step 7.
"Sender email address does not belong to the site domain."
Configuration validator warning. Set From to an address on your site’s domain (Step 2).
Emails contain literal text like [your-phone]
That mail-tag has no matching form-tag. Fix the field name in the Mail tab.
[contact-form-7 404 "Not Found"] appears on the page
The shortcode points to a form ID that doesn’t exist. Re-insert the form with the Contact Form 7 block.
Form redirects to a 404 page after submitting
The FAQ attributes this to two problems together: AJAX isn’t working, and a field uses a reserved WordPress name such as name, year, page or s. Rename the field and fix the JavaScript issue.
Troubleshooting checklist
Work through these in order and test after each change:
- Contact Form 7, WordPress and your theme are up to date. Version 6.2.5 includes security fixes. Per its WordPress.org listing it needs WordPress 7.1+ and lists PHP 8.3 as its minimum, so check your PHP version first (Tools → Site Health → Info → Server).
- Mail tab: valid To, From on your domain,
Reply-To: [your-email], no unmatched mail-tags. - No configuration-validator warnings after saving.
- Flamingo installed, and the test submission appears in Inbound Messages.
- Response colour identified: red (Step 5), orange (Step 6) or green (Step 7).
- SPF and/or DKIM in place for the domain and service that actually sends.
- SMTP plugin configured, and its own test email arrives.
- Spinner never stops or the page reloads: open your browser’s developer console and look for JavaScript errors. Contact Form 7’s FAQ points to plugin or theme conflicts, a theme missing
wp_head()/wp_footer(), invalid HTML, or a disabled REST API (Contact Form 7 uses the REST API for AJAX submissions). Test with other plugins deactivated and a default theme on a staging copy, not your live site. For a dedicated walkthrough, see our guide to Contact Form 7 not submitting or the spinner keeps spinning. - Still stuck: send your host the exact error, time of the test and recipient address.
Alternatives and limitations
- Another form plugin won’t fix delivery by itself. Every WordPress form plugin ultimately sends through
wp_mail()unless it has its own mail integration, so a switch without SMTP and correct DNS often hits the same problem. - Email isn’t a database. Even with perfect delivery, keep Flamingo (or your form plugin’s entry storage) so a temporary outage doesn’t lose enquiries.
- CRM or form services can store and route submissions outside WordPress. Weigh their cost and data-protection terms before switching.
- Limitations of this guide: we can’t cover every host’s mail restrictions or every SMTP provider’s settings. Your provider’s documentation is the authority for SMTP hosts, ports and DNS values. The steps here were verified against official documentation and haven’t yet been tested hands-on (see the note at the top).
FAQ
Why does Contact Form 7 say "sent" when I never receive the email?
The green message only confirms that WordPress’s mail function finished without error. After that, a mail server or spam filter can still drop or divert the message. Check spam folders, SPF/DKIM and your From address (Step 7).
Can I use the visitor’s email as the From address?
You shouldn’t. Contact Form 7’s documentation recommends a From address on your own domain to avoid looking like spoofed mail. Put the visitor’s email in Reply-To so replies still go to them.
Do I need an SMTP plugin for Contact Form 7?
Not always. If your host’s mail works and your domain is authenticated, default sending can work. SMTP through an authenticated provider is the most reliable long-term setup, and it gives you logs and test tools.
Is WP Mail SMTP’s free version enough?
It can route mail through a provider and send test emails. According to its WordPress.org page, email logging is a Pro feature. If you need free logs, FluentSMTP or WP Mail Logging list them as free features.
Why did my form work for months and then stop?
Mail providers tighten their rules over time (for example Google’s 2024 sender requirements), hosts change mail policies, and plugin updates can change settings. Contact Form 7’s own FAQ makes the point that a form that works today can fail if the environment changes. That’s why logging and authentication matter.
Where are Contact Form 7 messages stored?
Nowhere, by default. Install Flamingo to save them in your WordPress database.
Next step
Once your test enquiries arrive reliably, measure them. Our next guide shows how to track Contact Form 7 submissions as Google Analytics 4 key events, using the plugin’s wpcf7mailsent event, which only fires after the mail has been sent successfully.
References (official documentation, checked 12 November 2026)
- Contact Form 7: Setting up mail
- Contact Form 7: Best practice to set up mail
- Contact Form 7: FAQ, covering the red, orange and green messages, spinner, 404 redirects, REST API and sender name
- Contact Form 7: I get an error message with a red border
- Contact Form 7: FAQ about Configuration Validator and Configuration errors
- Contact Form 7: Save submitted messages with Flamingo
- Contact Form 7: Why is this message marked spam? (spam logging)
- Contact Form 7: Special mail-tags and Adding Cc, Bcc and other mail headers
- Contact Form 7: Why isn’t my AJAX contact form working correctly? and DOM events
- Contact Form 7: 6.2.5 release notes
- WordPress Developer Resources: wp_mail() and wp_mail_failed hook
- WordPress Advanced Administration: Debugging in WordPress
- Google Workspace Admin Help: Email sender guidelines
- IETF: RFC 7208, Sender Policy Framework, section 3.2 (multiple SPF records)
- PHPMailer source: error message strings
- Contact Form 7: reCAPTCHA and Disallowed list
- WordPress.org plugin pages: Contact Form 7, Flamingo, FluentSMTP, WP Mail SMTP, Post SMTP, WP Mail Logging
- Community source (tip only): WordPress.org support thread on emails showing as sent but not received
Last updated: 13 November 2026



