WordPress’s wp_mail() function does not send email on its own. It hands the message to PHPMailer, which by default calls PHP’s mail() — and that in turn hands the message to whatever local MTA is on the box, which on most shared and cloud hosts is either missing, misconfigured, or blocked outbound on port 25. The fix is always the same shape: intercept phpmailer_init and point PHPMailer at a real SMTP endpoint. What differs is where the interception lives. This tool picks a provider, picks the interception point, and returns the exact config for that combination.
WP Mail SMTP → Settings → Email → General
Open WP Admin → WP Mail SMTP → Settings and enter these values in the General tab. Save and use the "Send a Test Email" tab to confirm.
# nanoPost — SendGrid + WP Mail SMTP
# Review: https://nanopo.st/smtp-email-services/sendgrid/
# Guide: https://nanopo.st/guide/wp-mail-smtp-setup/
Mailer: SendGrid
API Key: [your SendGrid API key]
From Email: [email protected]
From Name: Your Site
Force From Email: On
Force From Name: On
Return Path: On (matches From Email)
- Most API-key mailers accept the literal string "apikey" as the SMTP username and the API key itself as the password. Check the provider docs if in doubt.
Snippet defaults come from the same providers.json dataset the rest of nanoPost’s tools use. Endpoint, port, and TLS mode are locked to whatever the provider actually accepts; auth is set to whichever credential model the provider prefers. Nothing is submitted anywhere — everything is generated in your browser or on this server and shown back to you.
The five delivery methods
- WP Mail SMTP (plugin settings) — the field-by-field walkthrough for the plugin’s UI. Native mailer where WP Mail SMTP ships one for the provider (SendGrid, Mailgun, Postmark, Amazon SES, Microsoft 365, Gmail, Zoho, Brevo, and the rest of its supported set); Other SMTP with host/port/encryption/auth otherwise.
- FluentSMTP (plugin settings) — same walkthrough style for FluentSMTP. Native connection provider where FluentSMTP has one; Other SMTP as a fallback.
- wp-config.php constants — the
WPMS_*constants WP Mail SMTP reads before its UI values. Useful when you want the config in source control and out of the database, or when you want to lock the settings so a site owner cannot change them from the admin. - mu-plugin — a full standalone must-use plugin at
wp-content/mu-plugins/nanopost-smtp-<provider>.php. Loads on every request, cannot be deactivated from the admin, and setswp_mail_from+wp_mail_from_nameon top of the SMTP transport. The right choice when outbound email must not silently fall back to PHPmail()because someone deactivated a plugin. - theme functions.php — a
phpmailer_initsnippet only. Simplest to paste, but only survives while the theme is active; do not use it in a parent theme you might switch away from.
What the defaults come from
The dataset is providers.json in the nanoPost Tools Common plugin. Each provider ships:
smtp.host— the actual endpoint. For Amazon SES the host contains a{region}placeholder the tool leaves in place — swap in the region your SES sending identity lives in before pasting.smtp.portsandsmtp.tls— the port + encryption combination the provider accepts. The tool prefers 587 with STARTTLS, then 465 with SMTPS, then falls back to whatever combination the provider publishes.smtp.auth_methods— the credential model.api-keymailers get usernameapikey+ password[your API key]; Postmark gets its server API token in both fields; ZeptoMail gets usernameemailapikey; SES gets its distinct SMTP credentials (not the IAM key/secret); OAuth-first providers get the app-password fallback with a caveat pointing at the plugin methods for the real OAuth flow.
Plugin-method availability comes from plugins.json[<plugin>].supports_mailers. The WP Mail SMTP row is only offered when the selected provider is in wp-mail-smtp.supports_mailers; same for FluentSMTP. Code-level methods work for every provider that has an SMTP block, which is every provider on file.
What the tool does not do
- No live SMTP test. The snippet is structurally valid for the provider; whether your credentials work is between you and the provider dashboard.
- No secrets stored. From-email and from-name are the only inputs, and they are only echoed back into the generated snippet in your browser — nothing is persisted, logged, or sent anywhere.
- No opinion on which provider you should pick. That’s what the SMTP cost calculator and each provider’s nanoPost review are for.
Related tools
- DNS Auth Checker — once the SMTP is wired, this checks whether SPF, DKIM, and DMARC actually authorise the mail the new snippet is about to send.
- SPF Record Merger — the mechanical step of adding the new provider’s
include:to your existing SPF record without blowing the 10-lookup ceiling. - SMTP Error Decoder — when the snippet is in place but a specific bounce message appears, this maps common SMTP reply codes to the actual fix.
