惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
IT之家
IT之家
B
Blog RSS Feed
罗磊的独立博客
GbyAI
GbyAI
博客园 - Franky
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
博客园 - 聂微东
N
Netflix TechBlog - Medium
博客园 - 三生石上(FineUI控件)
人人都是产品经理
人人都是产品经理
U
Unit 42
博客园 - 叶小钗
Jina AI
Jina AI
MyScale Blog
MyScale Blog
雷峰网
雷峰网
B
Blog
Hugging Face - Blog
Hugging Face - Blog
Blog — PlanetScale
Blog — PlanetScale
Recent Announcements
Recent Announcements
腾讯CDC
酷 壳 – CoolShell
酷 壳 – CoolShell

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Why wp_mail() silently eats your form notifications — and...
Vitalii Kiiko · 2026-06-22 · via DEV Community

Vitalii Kiiko

You build a contact form. You submit it. The "Thank you" message shows up. Everything looks fine.

Three weeks later a client mentions they never heard back. You check WordPress — the submission is right there in the database. The form worked. The email didn't.

This is one of those bugs that stays invisible until it costs you something, and it's far more common than it should be.

Why it happens

When WordPress calls wp_mail(), it hands the message to PHP's built-in mail() function, which asks your web server to deliver it directly. On a dedicated server with a properly configured MTA, this works. On the shared hosting plans that most WordPress sites actually run on, three things go wrong:

  1. No authentication. Gmail, Outlook, and corporate mail servers expect email from an authenticated sender. A bare mail() call carries none, so it lands in spam or gets rejected outright.
  2. No SPF or DKIM. These DNS records tell the world which servers are allowed to send for your domain. Shared hosts send for hundreds of domains and can't be listed in everyone's SPF. Result: soft fail → spam folder.
  3. Silent failure. mail() returns true when it hands the message to the local mail daemon — not when the message actually arrives. If it bounces later, WordPress never finds out. No log, no error, no trace.

The ugly part: you can have a contact form running for months, fully "working," with half the notification emails going nowhere — and you'd have no idea.

The fix: a dedicated SMTP service

SMTP replaces the guesswork with a proper handshake. You authenticate with a service that has managed IP reputation and DNS records, and you get a delivery log you can actually read. The good news: the free tiers are generous enough that most small sites never need to pay.

Here's the short version of the comparison:

Provider Free tier Best for
Brevo 300/day Quickest setup, beginners
Mailgun 100/day Best deliverability (bookings, payments)
SendGrid 100/day Long-term, clear upgrade path
Gmail SMTP 500/day Already on Google Workspace
Amazon SES ~$0.10/1K High volume, AWS users
Mailtrap 1K test/mo Testing and staging (sandbox inbox)

For most WordPress sites with a contact form, Brevo is the right starting point — 300 emails per day, no credit card, five-minute setup. If deliverability matters most (bookings, payment confirmations), go with Mailgun. If you're still building or testing, start with Mailtrap — its sandbox catches every outgoing email and shows you the full render before a real inbox ever sees it.

How to tell if you're affected

Before you sign up for anything, confirm you actually have a problem. If you use a form plugin that has a built-in email test (CraftForms has one under SMTP Servers — send a test email, get a 6-digit code, enter it to confirm), run that first. If the email arrives, your default mail works and you can stop here.

If it doesn't — or if you've had the "I never got your email" conversation even once — set up SMTP. Ten minutes now saves weeks of missed emails later.


I wrote the full walkthrough — all six providers compared in detail, step-by-step setup, email logging, and how to route different form actions through different SMTP servers — on my blog:

👉 Best Free SMTP for WordPress — Setup Guide

Disclosure: I build CraftForms, the form plugin I used for the examples. The SMTP providers and the underlying wp_mail() problem are the same regardless of which plugin you use.