Why are my website form emails going to spam?
Website form emails usually land in spam because the site sends them with PHP mail() from the web server, which isn't in your SPF record and doesn't DKIM-sign as your domain. Forms that put the visitor's address in From also fail DMARC. Send through authenticated SMTP or an email API, From your own domain, with Reply-To set to the visitor.
On this page 8 sections
Your contact form says "Thank you, we'll be in touch," but the message never reaches your inbox, or it sits in Junk. This is one of the most common email problems for small websites, and it usually has nothing to do with the form plugin. It comes down to how the website sends the email and which address it claims to send from.
Why do contact form emails go missing?
A contact form is a tiny email sender. When a visitor clicks Submit, your website builds a message and hands it to a mail program. From that point, the message is judged like any other email: receivers check whether the sending server is allowed to send for the domain in From, whether the message is signed, and whether the server has a good reputation.
Form mail often fails all three checks at once:
- It's sent from the web server. On many hosts, the website sends mail through PHP's built-in
mail()function, straight from the web server's IP address. That IP usually isn't in your domain's SPF record. - It isn't DKIM-signed as your domain. Mail handed to the local mail program typically goes out without a signature from your domain.
- The From address is wrong. Many forms put the visitor's address in From, so the message claims to come from
someone@gmail.comwhile being sent by your web server. - The server's reputation is shared. On shared hosting, many websites send from the same IP. Google's sender guidelines say "the activity of any senders using a shared IP address affects the reputation of all senders for that shared IP address."
None of this shows up on the website. The form reports success because the hand-off worked.
What does PHP mail() actually do?
WordPress sends email with wp_mail(). Its developer reference describes it as sending "an email, similar to PHP's mail function." In WordPress core, wp_mail() uses the PHPMailer library and sets it to PHP's mail() by default. If nothing else sets a sender, the default From address is wordpress@ followed by your site's domain.
PHP's manual for mail() is blunt about what success means: "just because the mail was accepted for delivery, it does NOT mean the mail will actually reach the intended destination." On Linux servers, mail() passes the message to the program set in sendmail_path, which is whatever mail software your host runs. WordPress gives the same warning: a true return value "does not automatically mean that the user received the email successfully."
So the website did its part. The mail server it handed off to is the part receivers judge.
Which sending method should your website use?
| Method | How it works | SPF and DKIM | Typical result |
|---|---|---|---|
PHP mail() (default) |
Web server's local mail program sends directly | Rarely covered by your SPF; usually unsigned | Junk, quarantine or rejection |
| Authenticated SMTP to your mailbox provider | Website logs in to a real mailbox and sends through it | Covered if your provider is already in SPF and DKIM is on | Good for low-volume notifications to your own team |
| Transactional email service or API | Website sends through a sending platform with an API key | Add the service to SPF and set up custom-domain DKIM | Good for confirmations and receipts to visitors |
| Outbound relay (smart host) | Website relays through a filtering service that signs mail | Add the relay to SPF; it DKIM-signs | Good for business mail from apps and devices |
For most small sites, the fix is to stop using mail() and send through an authenticated service. WordPress exposes a phpmailer_init hook that lets a plugin or theme reconfigure PHPMailer, which is how SMTP plugins switch WordPress to authenticated SMTP.
A note on Microsoft 365 and Google Workspace mailboxes
If you plan to send through a business mailbox, read your provider's current guidance first. Microsoft's guide for devices and applications lists client SMTP submission (SMTP AUTH), SMTP relay, Direct Send and High Volume Email. It says client SMTP submission with Basic authentication is scheduled for deprecation and recommends OAuth. It also notes that Direct Send can't deliver to external recipients such as Gmail or Yahoo users. If your form only notifies your own staff, that's fine; if it emails visitors, choose a method that can reach the internet.
Why should the From address be your own domain?
This is the single most important fix, and it costs nothing.
When a form puts the visitor's address in From, your web server is claiming to send as the visitor's domain. Receivers check DMARC for that domain, and your server isn't authorized for it. On October 9, 2026, yahoo.com and aol.com published DMARC policies of p=reject, which tells receivers to refuse unauthorized mail using those domains. Google's guidelines say "Don't impersonate Gmail From: headers."
Use the headers the way they were designed:
From: "Website contact form" <forms@yourdomain.com>
Reply-To: "Jane Visitor" <jane@example.com>
To: sales@yourdomain.com
You still click Reply and answer the visitor directly, because mail clients reply to the Reply-To address. And the message now claims to come from your domain, which you can authorize. To check what your domain publishes, run the DMARC Checker; our guide to what DMARC is explains alignment.
How do you set up SPF and DKIM for the sending service?
Once the form sends through a service, authorize that service for your domain.
- Pick one From address on your domain for all website mail, such as
forms@ornoreply@. Use a subdomain such asmail.yourdomain.comif your sending service recommends it. - Add the service to SPF. Your domain can have only one SPF record. Add the service's
include:to it rather than publishing a second record. The SPF record syntax guide shows how, and our provider SPF pages list the exact includes for common platforms such as Amazon SES and Mailgun. - Turn on custom-domain DKIM. Publish the CNAME or TXT records the service gives you, then enable signing. Without this, many services sign with their own domain, which passes DKIM but doesn't align with your From address.
- Check the records with the SPF Checker and DKIM Checker. Stay under SPF's 10-lookup limit.
- Send a real test to the Email Deliverability Test and look for SPF or DKIM passing for your domain and DMARC passing.
If you must keep sending from your own server, make sure its IP has a reverse DNS (PTR) name that resolves back to the same IP. Google requires valid forward and reverse DNS for all senders, and Yahoo asks for "valid, meaningful, non-generic" PTR names. Check yours with the PTR Lookup and see our reverse DNS guide. Shared hosting rarely lets you control this, which is another reason to send through a service.
How do spam bots make form email worse?
Unprotected forms attract bots. Each fake submission can trigger a notification to you and, if your form sends a copy or an auto-reply, a message to whatever address the bot typed. Attackers use this to flood a victim's inbox with confirmation emails, a tactic M3AAWG calls list bombing. Our guide to email bombing covers it from the victim's side.
The M3AAWG Sender Best Common Practices recommend using several defenses together:
- A CAPTCHA that must be completed before the form submits.
- Rate limits on submissions from the same IP address.
- Hidden honeypot fields that humans never see but bots fill in.
- A timestamp check that discards forms submitted faster than a person could type.
Also avoid sending the visitor a copy of whatever they typed. That turns your form into a tool for sending arbitrary text to arbitrary addresses. If you need a confirmation, send a short fixed message.
If you suspect abuse already happened, check your sending IP with the Blacklist Checker.
How do you troubleshoot a form that still isn't delivering?
Work through these in order:
- Look for a bounce. Set the envelope sender (Return-Path) to a mailbox you read. A rejection such as Gmail's 550 5.7.26 means authentication failed; 550 5.7.1 means the receiver refused the message by policy.
- Check Junk and quarantine. If you run a spam filter in front of your mailbox, look in its quarantine too.
- Read the headers of a delivered copy. Open the
Authentication-Resultsheader in the Email Header Analyzer. You wantspf=passordkim=passfor your domain, anddmarc=pass. - Check the plugin's mail log. Most SMTP plugins log each attempt and the server's reply.
- Test after every change. DNS changes can take time to reach every resolver.
If the problem is broader than the form, our guide on why your emails are going to spam covers sender-side causes in general.
Next steps
- Change your form's From address to one on your own domain and set Reply-To to the visitor.
- Switch the website from PHP
mail()to authenticated SMTP or an email API, and add that service to SPF and DKIM. - Send a test submission to the free Email Deliverability Test and fix anything that fails.
- Add a CAPTCHA and rate limits to every public form.
- If your site sends business notifications from your own systems, iBlockSpam's outbound relay DKIM-signs them, with 500 messages a month included.
Browse more guides on running email day to day.
Frequently asked questions
Why does my contact form say the message was sent when nothing arrives?
The success message only means your website handed the email to the server's mail program. WordPress says a true result from wp_mail() doesn't mean the user received it, and PHP's manual says the same about mail(). The receiving server can still reject, junk or quarantine it later.
Should the contact form email come from the visitor's address?
No. Put an address on your own domain in From, such as forms@yourdomain.com, and put the visitor's address in Reply-To. Your server isn't authorized to send as Gmail, Yahoo or any other visitor domain, so using it in From fails DMARC and is often rejected.
Do I need an SMTP plugin for WordPress forms?
You need WordPress to send through an authenticated service instead of PHP mail(). An SMTP or email-API plugin is the usual way. Developers can do the same with the phpmailer_init hook. Either way, the service must be in your SPF record and should DKIM-sign as your domain.
Can spam bots get my website's email server blocklisted?
Yes. Bots that submit forms thousands of times can turn auto-replies and notifications into a flood of unwanted mail from your server or account. M3AAWG recommends a CAPTCHA, rate limits per IP address, hidden honeypot fields and minimum fill-in times to protect forms from this abuse.
Why do form emails reach Gmail but not my Microsoft 365 inbox?
Each receiver weighs authentication and reputation differently. If the form sends as your own domain from a web server that isn't in SPF and doesn't sign with DKIM, your own mailbox provider may treat it as spoofing. Check the delivered message's headers for spf, dkim and dmarc results.
Sources
- WordPress Developer Resources: wp_mail()
- WordPress Developer Resources: phpmailer_init hook
- PHP Manual: mail()
- Gmail Help: Email sender guidelines
- Yahoo Sender Hub: Sender best practices
- Microsoft Learn: Set up a multifunction device or application to send email using Microsoft 365
- M3AAWG Sender Best Common Practices, Version 4.0 (August 2026)
See how your domain measures up
Run a free Email Health Check: MX, SPF, DKIM, DMARC and transport security in one scan, with the raw records shown. No sign-up.
Keep reading
Why are my emails going to spam, and how do I fix it?
Why your outgoing emails land in spam at Gmail or Outlook: authentication, alignment, spam complaints, blocklists, reverse DNS, new domains and forwarding.
10 min read Running email day to dayReverse DNS and PTR records for mail servers
What a PTR record is, why Gmail, Yahoo and others require forward-confirmed reverse DNS for sending IPs, who can set it, and how to check yours is right.
8 min read Running email day to dayWhy aren't my password reset emails arriving?
Why password reset and verification emails from your site or app go missing or land in spam, how to diagnose it step by step, and the fixes that hold up.
9 min read