WordPress sends every email through a single function, wp_mail(), defined in wp-includes/pluggable.php. wp_mail() builds a PHPMailer instance, populates it with the arguments the caller passed (to, subject, body, headers, attachments), and calls its send() method. PHPMailer’s default transport is mail, PHP’s built-in mail() function, which hands the message to the local MTA (sendmail, postfix, or whatever the host has installed). That is the sending pipeline out of the box: WordPress → PHPMailer → PHP mail() → the server’s mail transport agent → the recipient.
The default path is unreliable on almost every modern host and unusable on a growing number of them. Nearly every WordPress site of any size replaces it with an SMTP plugin that intercepts wp_mail() and routes the message through an authenticated connection to a transactional email provider instead.
The default path, in detail
Every plugin, theme, and core feature that sends email funnels through wp_mail(). That includes password resets, comment notifications, WooCommerce order confirmations, contact form submissions, and admin alerts. It is the single chokepoint. The function is declared if ( ! function_exists( 'wp_mail' ) ) inside pluggable.php, which is what allows an SMTP plugin to redefine it wholesale by loading before pluggable.php runs.
Absent that intervention, the sequence is:
- A caller (WooCommerce, WordPress core, a plugin) invokes
wp_mail( $to, $subject, $message, $headers, $attachments ). wp_mail()constructs a freshPHPMailerobject, applies thewp_mail_fromandwp_mail_from_namefilters to set the defaultFrom:header (usuallywordpress@<sitename>), and populates the message body.- PHPMailer’s
send()method routes to whichever transport is configured. The default ismail. - PHP’s
mail()function calls out to the operating system’s mail transport agent using thesendmail_pathphp.inisetting (typically/usr/sbin/sendmail -t -i). - The MTA on the server queues the message and attempts delivery via SMTP to the recipient domain’s MX host.
Two problems live in this default path. The first is technical: PHP’s mail() function has no route out on cloud platforms whose providers block port 25, is handed to a capped host relay on managed hosts such as Kinsta and WP Engine, and is capped on some shared hosts, each at its own number. FastComet allows 400 messages an hour on shared hosting, scripts included, and
DreamHost allows PHP scripts on its shared servers 200 recipients an hour per server. cPanel’s server-wide
hourly limit per domain is unlimited by default. A host can set a server-wide limit, and account packages can set lower limits. The second is authentication: even when mail() works, the message can leave with no DKIM signature for the WordPress site’s domain, or with one that does not align with it. Kinsta documents that its relay is not DMARC-aligned to your domain, WP Engine provides no DKIM key for its relay, and DreamHost documents that PHP mail is not DKIM-signed. cPanel turns DKIM on for new accounts by default, but warns that it may not verify on mail sent from PHP applications on some server setups. When neither SPF nor DKIM authenticates a message to a personal Gmail account, Google says it might be marked as spam or rejected. Microsoft 365 may send such mail to Junk. See Form not sending mail to Gmail (but sending to Office 365) for a case where form mail reached Microsoft 365 but not a Google Workspace mailbox.
The path most sites actually use
An SMTP plugin, WP Mail SMTP, FluentSMTP, or Post SMTP, replaces the wp_mail() function with its own version, or filters PHPMailer’s transport, so that PHPMailer::send() opens an authenticated connection to a transactional provider (Postmark, SMTP2GO, Amazon SES, Brevo, Mailgun, and so on) instead of calling PHP’s mail(). The message body, subject, and headers built by the original caller are unchanged; only the transport underneath is swapped.
The rewritten pipeline is: WordPress → wp_mail() (plugin-provided) → provider SMTP or API → recipient. The site’s own DNS carries the SPF record authorising the provider and the DKIM public key the provider uses to sign outgoing messages, so mail arriving at Gmail or Microsoft 365 authenticates as the WordPress site’s domain and lands in the inbox.
Some plugins skip SMTP entirely for supported providers and use the provider’s HTTP API instead (Postmark, Mailgun, SendGrid, Amazon SES all expose one). From the WordPress side the behaviour is identical: wp_mail() is called, the plugin intercepts, the message goes out authenticated. The transport underneath is a POST request rather than an SMTP conversation.
What determines whether default sending works at all
Three variables decide whether the default mail() path produces any deliverable email on a given install:
- Whether PHP’s
mail()is enabled on the host. Kinsta and WP Engine document MailChannels for WordPress mail. Flywheel says it uses SendGrid to authenticate website email and a third-party managed SMTP provider for WordPress system email. Pressable describes its default as a built-in email server. Shared-host providers publish different outgoing-email limits: SiteGround lists 400 messages per hour per site on its entry plans, Bluehost 200 per hour per hosted domain, and GoDaddy 500 per hour for all users on a cPanel Web Hosting account, with a separate 500-per-day limit per email user. These provider pages do not say whether those quotas apply to PHPmail(). cPanel’s “Max hourly emails per domain” setting defaults to Unlimited, but hosts can set a lower value. SiteGround documents DKIM as enabled by default for its email service, but does not specify whether PHPmail()messages are signed in every server setup; Bluehost and GoDaddy do not document whether theirs is signed. See WordPress hosts and email for the per-host picture. - Whether the sending domain has SPF and DKIM published.
Google requires at least one of the two from every sender to personal Gmail accounts and says mail with neither might be marked as spam or rejected. Microsoft 365 may send such mail to Junk. See How to set up DNS for WordPress email: SPF, DKIM, DMARC for the records that need to be published. - Whether any plugin has overridden
wp_mail()or set a customFrom:address that doesn’t align with the DNS above. WooCommerce, membership plugins, and contact form plugins routinely set their ownFrom:headers, which can misalign against DKIM or SPF and produce silent authentication failures.
The WordPress email test suite is the canonical procedure for confirming which path the site is on and whether outgoing mail authenticates correctly at the major mailbox providers.
The full setup, from scratch
For a site starting from the default configuration and needing a reliable sending pipeline, see WordPress email setup: the complete guide. Three steps (choose a transactional provider, configure an SMTP plugin against it, publish SPF and DKIM on the domain) and the pipeline goes from unreliable default to authenticated production-grade.
Corrections
- 2026-10-29: earlier versions said PHP
mail()is blocked by security policy on managed WordPress hosts and disabled on much of the shared-hosting market. Managed hosts such as Kinsta and WP Engine route it through a capped relay, and most shared hosts throttle it rather than disable it. - 2026-11-23: an earlier version said
mail()usually leaves with no DKIM signature for the site’s domain, and a list further down still said managed hosts disablemail()and shared hosts send it unauthenticated. Managed hosts hand it to a relay of their own, SiteGround documents DKIM as on by default for its email service without saying whether PHPmail()is signed, and cPanel’s stock setting turns DKIM on for new accounts. - 2026-11-26: an earlier version said Gmail treats mail without both SPF and DKIM as spam or rejects it outright. Google requires at least one of the two from every sender to personal Gmail accounts and says mail with neither might be marked as spam or rejected.
- 2026-11-26: an earlier version said most shared hosts limit
mail(), typically to 100-500 messages an hour. The server-wide cPanel limit defaults to unlimited, though account packages can set lower limits. - 2026-11-26: an earlier version said Kinsta, WP Engine, Flywheel and Pressable route
mail()through relays of their own, and the 2026-11-23 note above repeats that wording. Kinsta and WP Engine document MailChannels for WordPress mail. Flywheel says it uses SendGrid to authenticate website email and uses a third-party managed SMTP provider for WordPress system email. Pressable describes its default as a built-in email server. The 2026-10-29 note above also said most shared hosts throttlemail(). Host pages publish different outgoing-email limits, but do not say whether they apply to PHPmail(); cPanel’s “Max hourly emails per domain” setting defaults to Unlimited.
