{codevo}

Contact form not sending email? How to find the cause and fix it

Updated · 4 min read · by the Codevo team

Short answer

Most contact forms fail because they send through PHP mail(), which many hosts block or which Gmail and Outlook treat as spam. Fix it by sending through SMTP with a real mailbox on your domain or a transactional email service, set the From address to that domain, and add SPF, DKIM and DMARC records.

What you might be seeing

  • ✗The form says "Thank you, your message has been sent" but no email arrives.
  • ✗Contact Form 7 shows "There was an error trying to send your message. Please try again later."
  • ✗Enquiries arrive in Gmail's spam or promotions folder, or only some of them arrive.
  • ✗We used to get enquiries every week from the website and now we get none.
  • ✗Customers say they filled the form but we never heard about it.

Common causes

Roughly in order of how often we see them.

  1. 01

    PHP mail() blocked or limited by the host

    WordPress and most form plugins send with PHP mail() by default. Many hosts disable it, rate-limit it, or send it from a shared server IP with a poor reputation, so the message is dropped or rejected without any error on your site.

  2. 02

    No SMTP authentication

    Without SMTP the email is not sent through a real, logged-in mailbox. Receiving servers like Gmail and Outlook have no reason to trust it and often reject it or file it as spam.

  3. 03

    From address does not match the domain

    If the form sends "From: customer@gmail.com" (the visitor's address) from your server, Gmail sees a message claiming to be from gmail.com that did not come from Google and rejects it. The From must be an address on your own domain; put the visitor's address in Reply-To instead.

  4. 04

    SPF, DKIM or DMARC missing or wrong

    These DNS records tell receiving servers which services may send mail for your domain. Since 2024 Gmail and Yahoo require SPF or DKIM for all senders, so mail from a domain without them often goes to spam or bounces. A common mistake is having two SPF records, which makes both invalid.

  5. 05

    Emails going to spam on the receiving side

    Sometimes the email is sent fine but lands in the spam or junk folder of the inbox you check, or a filter rule moves it. This is especially common when the To and From address are the same.

  6. 06

    reCAPTCHA misconfigured

    Wrong site or secret keys, keys created for a different domain, or mixing reCAPTCHA v2 and v3 can block every submission. Some setups fail silently, so the visitor sees a spinner or a vague error.

  7. 07

    Form plugin or theme errors

    An outdated form plugin, a conflict with a caching or security plugin, or a JavaScript error on the page can stop the form from submitting at all. Changes to the Mail tab, such as a typo in the To address, also break delivery.

What you can check yourself

Safe steps you can try before calling anyone. Take a backup before changing anything.

  1. 1

    Check spam and junk folders first

    Search the inbox that should receive enquiries, including Spam, Junk and Gmail's Promotions tab, for your site name or the form subject. Also check any filter rules or forwarding set up on that mailbox.

  2. 2

    Send a test and note what the form says

    Fill the form yourself from a phone or incognito window. Note the exact message shown after you submit. A red error means the form or server failed; a green "sent" message with no email means the mail was sent but dropped or filtered later.

  3. 3

    Check the form's mail settings

    In WordPress go to Contact → Contact Forms → your form → Mail tab (for Contact Form 7), or the Notifications settings in WPForms or Gravity Forms. Check the To address is correct and the From address is on your own domain, for example enquiry@yourdomain.com, not the visitor's email.

  4. 4

    Test your domain's email setup

    Go to mail-tester.com, copy the test address it gives you, and put it as the To address in your form temporarily (take a note of the original first). Submit the form, then check the score. It will tell you if SPF, DKIM or DMARC are missing and if your server is on a blacklist.

  5. 5

    Ask your host if PHP mail is allowed

    Open a ticket asking: "Is PHP mail() enabled on my plan, are there sending limits, and can you see delivery logs for my domain?" In cPanel you can also check Email → Track Delivery to see whether messages were sent, bounced or rejected.

When to call a developer

  • →mail-tester shows SPF, DKIM or DMARC problems and you are not comfortable editing DNS records.
  • →Emails still go missing after setting up an SMTP plugin.
  • →The form shows an error on submit or does nothing when the button is clicked.
  • →Your domain or server IP shows up on a spam blacklist.
  • →The site is custom-built (not WordPress) and you do not know how the form sends mail.

How we fix it

  1. [1]We submit the form and follow the message: browser console and network tab for front-end errors, then the server mail log or the host's delivery tracking to see if it left the server and what the receiving server replied.
  2. [2]We switch sending from PHP mail() to authenticated SMTP, using a mailbox on your domain (Google Workspace, Zoho Mail or your host's email) or a transactional service such as Brevo, Amazon SES or Postmark for higher volume.
  3. [3]We set the From address to your domain, move the visitor's email into Reply-To so you can still hit reply, and fix the To address and subject so enquiries are easy to filter.
  4. [4]We add or correct SPF, DKIM and DMARC in your DNS, merge duplicate SPF records, and recheck with mail-tester until the setup passes.
  5. [5]We check reCAPTCHA keys and plugin conflicts, and where it makes sense we turn on saving submissions to the database (for example with Flamingo for Contact Form 7) so no enquiry is lost even if one email fails.

Want the details on how we handle bug fixes and maintenance? See our bug fixing service.

Questions people ask

Q.01Why is my contact form not sending emails?

Usually because it relies on PHP mail(), which your host blocks or which Gmail and Outlook reject as untrusted. A From address that does not match your domain and missing SPF or DKIM records are the next most common reasons. Sending through SMTP with a real mailbox on your domain fixes most cases.

Q.02Why is Contact Form 7 not sending email in WordPress?

Contact Form 7 uses WordPress's built-in wp_mail(), which uses PHP mail() unless an SMTP plugin is installed. Check the Mail tab for the right To address and a From address on your own domain. Then install an SMTP plugin such as WP Mail SMTP or FluentSMTP and send a test email from its settings page.

Q.03Why are my website form emails going to spam?

The most common reasons are missing SPF, DKIM or DMARC records, a From address that does not match the sending domain, or a shared server IP with a poor reputation. Run a test through mail-tester.com to see which one applies. Marking a few messages as "Not spam" helps a little but does not fix the cause.

Q.04What is SMTP and do I need it for my website?

SMTP is the standard way to send email through a mail server that checks your username and password. For a business website, yes, you should use it: email sent through an authenticated mailbox or transactional service is far more likely to reach the inbox than PHP mail().

Q.05Can I use my Gmail account for website form emails?

You can send through a Gmail or Google Workspace account with an SMTP plugin, using an app password or Google's OAuth connection. For a business, an address on your own domain looks more trustworthy and keeps SPF and DKIM simple. Personal Gmail also has daily sending limits.

→/Next step

Still stuck? Send it to us and we'll take a look.

Tell us about your project or the issue you're facing. We'll reply with next steps and a free consultation.

support@thecodevo.com