Contact forms are one of the most common features on websites, and "my form is not sending email" is one of the most common support questions we receive. The problem is almost never the server. Here are the actual causes and how to fix them.
Use an SMTP plugin instead of PHP mail()
The PHP mail() function sends email without authentication, which means receiving servers often flag these messages as spam or reject them outright. Installing an SMTP plugin (like WP Mail SMTP for WordPress) that authenticates with your actual email account dramatically improves deliverability.
01. Check Your Spam Folder First
Before troubleshooting anything else, check your spam or junk folder. Form submissions sent via PHP mail() are frequently caught by spam filters because they lack proper authentication headers. If you find the emails in spam, the fix is to switch to SMTP (covered in section 03).
Also check that the "To" address in your form configuration is correct. A typo in the recipient email address is more common than you might expect.
02. PHP mail() Function Issues
Most contact form plugins and custom PHP forms use the PHP mail() function by default. This function hands the email off to the server's local mail system (Exim on our servers) for delivery. It works, but it has limitations:
- No authentication - The email is sent from the server without proving who the sender is. Receiving servers increasingly reject or spam-filter unauthenticated mail.
- Generic headers - The From address, Return-Path, and other headers may not match your domain, triggering SPF failures.
- No delivery feedback -
mail()returns true if the email was accepted by the local mail queue, but you have no way to know if it was actually delivered.
If your form was working and suddenly stopped, check your account's error_log file in public_html for PHP errors. Also check cPanel > Email > Track Delivery to see if the server attempted to send the message and what happened.
03. Use SMTP Instead of PHP mail()
The best fix for form email problems is to bypass mail() entirely and send through your actual email account using SMTP. This authenticates the sender, adds proper headers, and dramatically improves deliverability.
For WordPress
Install the WP Mail SMTP plugin (or FluentSMTP, Post SMTP, or similar) and configure it with your hosting email credentials:
- SMTP Host:
mail.yourdomain.com - SMTP Port: 465
- Encryption: SSL
- Authentication: On
- Username: A real email account on your domain (e.g.,
forms@yourdomain.com) - Password: That account's password
Most SMTP plugins include a "Send Test Email" feature. Use it to verify everything works before relying on it for your contact form.
Create a dedicated email account in cPanel specifically for your form submissions, like forms@yourdomain.com or noreply@yourdomain.com. This keeps form traffic separate from your personal email and makes it easy to track deliverability.
For Custom PHP Scripts
Use the PHPMailer library instead of mail(). PHPMailer supports SMTP authentication and is already available on most hosting accounts. Here is a minimal example:
<?php
use PHPMailer\PHPMailer\PHPMailer;
require 'vendor/autoload.php';
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host = 'mail.yourdomain.com';
$mail->SMTPAuth = true;
$mail->Username = 'forms@yourdomain.com';
$mail->Password = 'your-email-password';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->setFrom('forms@yourdomain.com', 'Your Site Name');
$mail->addAddress('you@yourdomain.com');
$mail->Subject = 'Contact Form Submission';
$mail->Body = 'Message content here';
$mail->send();
?>
04. The "From" Address Problem
A very common issue: your form sets the "From" address to the visitor's email address (the person filling out the form). This causes SPF failures because the email is being sent from your server but claims to be from gmail.com, yahoo.com, or wherever the visitor's email lives. The receiving server checks SPF records and sees that your server is not authorized to send email for gmail.com, so it rejects the message.
The fix: always set the "From" address to an email account on your own domain. Put the visitor's email in the "Reply-To" header instead. This way, when you hit reply, your email client will address the reply to the visitor, but the SPF check passes because the From address matches your domain.
Never set the From address to the form submitter's email. Use your own domain's email as From and set Reply-To to the submitter's address. This is the single most common cause of form emails being silently dropped.
05. WordPress Contact Form Troubleshooting
If you use Contact Form 7, WPForms, Gravity Forms, or Ninja Forms:
- Install an SMTP plugin (section 03) - This fixes 90% of WordPress form email issues.
- Check the form's "From" setting - Set it to an address on your domain, not
{your-email}which uses the submitter's address. - Check spam protection - If you use reCAPTCHA or Akismet, make sure the keys are valid. Expired keys can silently block form submissions.
- Check the form's mail tab - In Contact Form 7, go to the form's "Mail" tab and verify all fields are correct. Look for red warning icons.
- Test with a simple form first - Create a basic form with just a name and email field to rule out complexity issues.
06. Custom PHP Form Scripts
If you wrote your own form handler in PHP:
- Check
error_log- Look inpublic_html/error_logfor PHP errors that might be preventing the script from executing. - Verify the script runs at all - Add
error_log("Form submitted");at the top of your handler and check the log after submitting. - Check form action URL - Make sure the form's
actionattribute points to the correct PHP file. - Check for disabled functions - On shared hosting, some PHP functions are disabled for security. See PHP system/exec Functions Disabled. The
mail()function itself is not disabled, but if your script callsexec()orsystem()for some reason, those will fail. - Switch to PHPMailer - Replace
mail()with PHPMailer for authenticated SMTP sending (see section 03).
Form Still Not Sending?
If you have tried SMTP configuration and the email still is not arriving, open a ticket and tell us your domain, which form plugin you use, and whether you see any errors in Track Delivery.
Open a Support TicketQuick Recap
- Check spam first - Form emails often land in junk folders
- Use SMTP, not PHP mail() - Install WP Mail SMTP or use PHPMailer with your email credentials
- Set "From" to your own domain - Never use the submitter's email as the From address
- Put the visitor's email in Reply-To - So replies go to the right person
- Test with the SMTP plugin's test email feature - Verify delivery before relying on it
Helping users fix contact form email delivery · Last updated March 2026 · Browse all Email articles
