Skip to content

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy
Wordpress

WordPress: Fix a Contact Form That Stops Sending Emails After a Host Migration

- 31.08.26 - ErcanOPAK

📝 The Form Submits Successfully – The Email Never Arrives

A contact form worked reliably for months, and right after migrating to a new host, submissions still show a ‘Message sent!’ success message – but the emails themselves stop arriving. Nothing about the form’s code or settings changed; the new server environment did.

🐞 The Problem

Form shows: "Thank you! Your message has been sent."
Inbox: nothing arrives, not even in spam, for any submission
since the migration completed.

🔍 Why This Happens

Most WordPress contact form plugins send email through PHP's
built-in mail() function by default, which hands off delivery to
whatever local mail transport agent the SERVER provides - and many
hosts either don't configure one at all, or configure it in a way
that gets flagged and silently dropped by receiving mail servers
(missing SPF/DKIM records for the new server's IP, no relay
configured). The form itself has no way to know the send failed,
so it shows success regardless.

✅ The Fix: Switch From PHP mail() to a Proper SMTP/Email API

  • Install an SMTP plugin (WP Mail SMTP or similar) and configure it to send through an actual authenticated email service (Gmail, SendGrid, Mailgun, your domain registrar’s email) instead of relying on the server’s raw mail() function.
  • Use that same plugin’s built-in test-email feature to confirm delivery works BEFORE assuming the contact form itself is fixed — this isolates whether the problem is the form or the underlying mail transport.
  • Confirm SPF and DKIM DNS records for your sending domain are correctly set for the new host/email service — missing or outdated records are the single most common reason legitimate mail gets silently dropped rather than landing in spam where at least you’d notice it.

⚠️ Why ‘It Says Sent’ Isn’t Proof of Delivery

  • A contact form’s success message only confirms the PHP script finished running without throwing an error – mail() itself returns ‘true’ the moment it hands the message off locally, regardless of whether it ever actually reaches the recipient’s inbox.
  • Check the new host’s control panel for any outbound email logs or limits – some hosts silently rate-limit or block mail() entirely as a spam-prevention default, precisely the kind of change that wouldn’t have existed on the old host.

A ‘message sent’ confirmation only ever proved your form ran — delivery was always a separate promise, made by a mail server your migration just quietly swapped out from under you.

— WordPress Admin

Related posts:

The White Screen of Death Fix (WP_DEBUG)

WordPress: Recover Deleted Media Files That Are Still Referenced in Old Posts

WordPress: Use Query Monitor to Debug Performance Issues

Post Views: 4

Post navigation

C#: Fix the Null Reference Exception That Only Happens After Awaiting an Async Method
Kubernetes: Fix a Pod Stuck in CrashLoopBackOff Because of a Missing Environment Variable

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

October 2026
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  
« Sep    

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (973)
  • How to make theater mode the default for Youtube (952)
  • How to add default value for Entity Framework migrations for DateTime and Bool (939)
  • Get the First and Last Word from a String or Sentence in SQL (847)
  • How to select distinct rows in a datatable in C# (837)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (624)
  • Add Constraint to SQL Table to ensure email contains @ (590)
  • Average of all values in a column that are not zero in SQL (553)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (526)
  • Find numbers with more than two decimal places in SQL (468)

Recent Posts

  • CSS: Fix a prefers-color-scheme Media Query That Gets Silently Overridden by a Browser Extension’s Forced Dark Mode
  • Git: Fix a Merge Commit That Silently Drops a File Because Both Branches Deleted It Differently
  • HTML5: Fix a Native Lazy-Loading Image That Never Loads Because It Sits Inside a Hidden Tab Until the User Clicks It
  • The AI Prompt That Traces a Null Reference Exception Back to the Exact Line That First Produced the Null
  • The AI Prompt That Turns a Gym Membership Contract’s Fine Print Into a Plain-English List of Cancellation Steps
  • Photoshop: Fix a Color Profile Mismatch That Makes Printed Output Look Nothing Like What You Saw On Screen
  • WordPress: Fix Search Results That Return Pages From a Theme You Deactivated Months Ago
  • Visual Studio: Fix a Test Project That Builds Fine Alone but Fails to Discover Any Tests After a NuGet Restore
  • ASP.NET Core: Fix a File Upload That Times Out on Slow Connections Only Because Kestrel’s Minimum Data Rate Feature Kicked In
  • JavaScript: Fix an Array Destructuring Default Value That Silently Never Applies Because null Was Passed Instead of Undefined

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (973)
  • How to make theater mode the default for Youtube (952)
  • How to add default value for Entity Framework migrations for DateTime and Bool (939)
  • Get the First and Last Word from a String or Sentence in SQL (847)
  • How to select distinct rows in a datatable in C# (837)

Recent Posts

  • CSS: Fix a prefers-color-scheme Media Query That Gets Silently Overridden by a Browser Extension’s Forced Dark Mode
  • Git: Fix a Merge Commit That Silently Drops a File Because Both Branches Deleted It Differently
  • HTML5: Fix a Native Lazy-Loading Image That Never Loads Because It Sits Inside a Hidden Tab Until the User Clicks It
  • The AI Prompt That Traces a Null Reference Exception Back to the Exact Line That First Produced the Null
  • The AI Prompt That Turns a Gym Membership Contract’s Fine Print Into a Plain-English List of Cancellation Steps

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com