How to Set Up WordPress SMTP (Fix Your Email Deliverability for Good)
To set up WordPress SMTP, install a plugin like WP Mail SMTP, enter your mail server’s host, port 587 with TLS encryption, and your SMTP username and password — then send a test email to confirm delivery. This replaces WordPress’s broken default mail() function with authenticated SMTP, jumping your email deliverability from roughly 64% to over 96%. If your contact forms, password resets, or WooCommerce order confirmations are vanishing, this is the fix.
This guide is going to walk you through exactly how to set up WordPress SMTP from scratch — why the default mail system is broken by design, which SMTP providers are worth your time, how to use the most popular plugin on the planet to get it done, and how to do it in pure code if you’d rather keep your plugin list lean. By the time you’re done reading, you’ll have a WordPress site that actually delivers email. Wild concept, right?
⚡ Key Takeaways
- WordPress’s default PHP
mail()function has no authentication and delivers emails only ~64% of the time — SMTP pushes that to ~96.4%. - Learning how to set up WordPress SMTP takes under 15 minutes and permanently fixes missing emails.
- Port 587 with TLS encryption is the gold standard — avoid port 25 like bilge water.
- WP Mail SMTP (4+ million installs) is the easiest plugin method; a custom
functions.phpsnippet works if you want zero plugins. - Gmail, Brevo, SendGrid, Mailgun, and Amazon SES are the top SMTP providers — each has a free tier.
- Always test after setup using WP Mail SMTP’s built-in test tool or a staging environment.
- Keep bounce rates under 2% and spam complaints under 0.1% to protect your sender reputation.
Why WordPress Email Breaks in the First Place
Before you can understand how to set up WordPress SMTP, you need to understand why the default setup is a disaster waiting to happen. WordPress sends email using PHP’s native mail() function, wrapped in the core wp_mail() function. You can read the official documentation at WordPress.org’s wp_mail() reference. The problem isn’t the function itself — it’s what happens when that function tries to send an email.
PHP’s mail() function doesn’t authenticate with any mail server. It just tosses an email out the door and hopes the internet catches it. Modern email providers — Gmail, Outlook, Yahoo, corporate mail servers — have become brutally good at detecting unauthenticated email. They see it, they smell it, they trash it. Or worse, they silently drop it. Your WordPress dashboard says “sent,” but the email never existed as far as the recipient’s inbox is concerned. This is the core reason understanding how to set up WordPress SMTP matters so much.
SMTP — Simple Mail Transfer Protocol, standardized in RFC 5321 — is the actual standard for sending email across the internet. When you configure how to set up WordPress SMTP correctly, your site logs into a real mail server with a real username and password, encrypts the connection, and sends mail the right way. Receiving servers see authenticated, encrypted email from a reputable sender and let it through.
🏴☠️ Pirate Tip
Your hosting provider almost certainly has PHP mail disabled or throttled to protect their own server reputation. That’s why even a brand-new WordPress install might not send a single email. Don’t fight your host — configure SMTP and route emails through a dedicated mail service. Your host will thank you. Your users will definitely thank you.

The Hard Numbers: PHP Mail vs. SMTP Deliverability
Let’s talk data, because this is where the argument for learning how to set up WordPress SMTP becomes completely undeniable. The deliverability gap between PHP’s default mail function and authenticated SMTP isn’t a minor inconvenience — it’s a canyon.
📊 Deliverability Stat Block
Those numbers aren’t academic. If you’re running a WooCommerce store sending 1,000 order confirmation emails a month, using PHP mail means roughly 360 of those customers never get their confirmation. They open a support ticket. They leave a bad review. They dispute the charge. All because nobody told the site owner how to set up WordPress SMTP.
And the deliverability story gets worse over time. Every time your server sends an unauthenticated email that gets flagged as spam, your server’s IP reputation takes a hit. ISPs maintain blacklists. If your hosting server’s IP ends up on one, even your authenticated emails will struggle. The best time to learn how to set up WordPress SMTP was before you launched your site. The second best time is right now.

Choosing Your SMTP Provider: The Full Breakdown
Knowing how to set up WordPress SMTP means picking the right service to route your emails through. There’s no single “best” provider — the right choice depends on your volume, budget, and how much you enjoy reading API documentation at 2am. Here’s the honest breakdown:
Gmail / Google Workspace
Free Gmail accounts can send up to 500 emails/day through SMTP. Google Workspace bumps that to 2,000/day. If you’re learning how to set up WordPress SMTP with Gmail, you’ll find it reliable, well-documented, and most WordPress SMTP plugins have a dedicated Google integration. The downside: Google made OAuth mandatory for Gmail SMTP, so you can’t just throw in a username and password anymore — you need to connect via the API. WP Mail SMTP handles this beautifully. Best for: small sites, personal projects, low email volume.
Brevo (formerly Sendinblue)
Brevo offers 300 free emails per day on their free plan with no credit card required. They have dedicated WordPress documentation and excellent deliverability rates. If you’re figuring out how to set up WordPress SMTP for a small business site, Brevo is genuinely one of the best free options available. Their SMTP credentials are simple — no OAuth circus, just a login and API key.
SendGrid
Twilio SendGrid gives you 100 free emails per day forever (after the trial). It’s a popular choice when figuring out how to set up WordPress SMTP on a developer-friendly platform with excellent analytics, bounce management, and deliverability tools. If you ever want to get serious about understanding your email performance, SendGrid’s dashboard is one of the best in the business. Great for medium-traffic sites and developers who want data.
Mailgun
Mailgun is a developer-first transactional email service owned by Sinch and another solid option when mastering how to set up WordPress SMTP. Their free trial gives you 100 emails/day for the first month, then you need a paid plan. The logs and analytics are exceptional. If you’re running an e-commerce operation and need to track exactly what happened to every email, Mailgun is a serious tool. Slightly more technical to set up — but that’s what this guide is for.
Amazon SES
Amazon Simple Email Service is the cheapest option at scale — $0.10 per 1,000 emails. If your site sends tens of thousands of emails monthly, SES will save you a fortune compared to any other provider. The setup is more involved (you need an AWS account, domain verification, and usually getting out of the sandbox mode), but for high-volume WordPress sites, it’s the undisputed price-performance winner. Pair it with a plugin that supports SES natively, like WP Mail SMTP Pro, to make setup manageable.

Understanding SMTP Ports and Encryption
If you want to truly understand how to set up WordPress SMTP, you need to get comfortable with ports and encryption. Don’t zone out — this section takes two minutes and will save you hours of troubleshooting.
- Port 25 — The original SMTP port. Almost universally blocked by hosting providers and ISPs because it’s the favorite toy of spammers. Do not use this unless you enjoy pain.
- Port 465 — SMTP over SSL (Secure Sockets Layer). Technically deprecated but still widely supported. If your provider only offers 465, it’s fine — just select SSL as your encryption type.
- Port 587 — SMTP with STARTTLS (Transport Layer Security). This is the recommended modern standard. When in doubt, use port 587 with TLS. Every major provider supports it.
- Port 2525 — An alternative port used by some providers (like Mailtrap) as a fallback when 587 is blocked. Less common but useful to know.
When you’re working through how to set up WordPress SMTP, the encryption setting in your plugin or code needs to match what your provider requires. Using SSL with port 587 or TLS with port 465 will fail. Match the port to the encryption type and you’ll avoid one of the most common SMTP configuration mistakes.
“Using PHP mail on a production WordPress site in 2024 is like sending customer letters via carrier pigeon and wondering why clients aren’t responding. SMTP isn’t optional — it’s the minimum viable email setup.”

How to Set Up WordPress SMTP Using WP Mail SMTP Plugin
This is the method that covers 90% of WordPress sites. WP Mail SMTP is the most-installed WordPress email plugin on the planet — over 4 million active installs at last count — and for good reason. It’s well-maintained, beginner-friendly, supports every major provider, and the free version handles everything most sites need. Here’s exactly how to set up WordPress SMTP using this plugin, step by step.
Step 1: Install and Activate WP Mail SMTP
From your WordPress dashboard, go to Plugins → Add New. Search for “WP Mail SMTP.” Install and activate the plugin by WPForms — this is the first real step in how to set up WordPress SMTP via plugin. Once activated, you’ll see a setup wizard — you can use it or go directly to WP Mail SMTP → Settings.
Step 2: Choose Your Mailer
Under the “Mailer” section, you’ll see all supported providers — a critical decision point in how to set up WordPress SMTP. Pick yours. For each provider, WP Mail SMTP shows you exactly what credentials you need. If you’re using Gmail, it walks you through the Google API OAuth flow. If you’re using Brevo or SendGrid, you’ll paste in an API key. If you want to use a generic SMTP server (like your host’s mail server or Mailgun’s SMTP gateway), choose “Other SMTP.”
Step 3: Configure the “From” Details
Set your “From Email” to match the domain you’re sending from (e.g., hello@yourdomain.com). This is critical for deliverability — the from address should match the domain you’ve verified with your SMTP provider. Set a “From Name” that makes sense for your brand. Check the box to force these settings so plugins like WooCommerce or Contact Form 7 don’t override them.
Step 4: Enter SMTP Credentials (for “Other SMTP”)
If you selected “Other SMTP,” you’ll see fields for SMTP host, port, encryption type, and authentication credentials. Here’s what each field means when learning how to set up WordPress SMTP with a generic provider:
- SMTP Host — Your provider’s mail server address (e.g., smtp.brevo.com, smtp.sendgrid.net)
- SMTP Port — 587 (TLS) in almost every case
- Encryption — TLS (matches port 587)
- Authentication — Set to ON
- Username — Your login email or the specific SMTP username from your provider
- Password — Your SMTP password or API key (treat this like a bank password)
Step 5: Save and Test
Click “Save Settings.” Then navigate to WP Mail SMTP → Tools → Email Test. Enter your email address and click “Send Email.” Check your inbox. If it arrives in your inbox (not spam), you’ve successfully completed how to set up WordPress SMTP. If it lands in spam, you have a domain reputation or DNS configuration issue — check your SPF, DKIM, and DMARC records.

🏴☠️ Mid-Post CTA
Stop Guessing. Start Building.
Every serious WordPress operator needs the right tools. Browse the AI Or Die Now Arsenal for the plugins, services, and resources we actually use and recommend.
⚔️ Visit the ArsenalHow to Set Up WordPress SMTP Without a Plugin (Code Method)
Plugin-averse? Good. Keeping your plugin count lean is a legitimate performance and security strategy — and you can read more about both in our guide on how to speed up WordPress and our deep dive on how to secure your WordPress site. The good news: learning how to set up WordPress SMTP via code is simpler than you might think, thanks to the phpmailer_init hook.
WordPress uses PHPMailer under the hood to handle wp_mail() calls. PHPMailer exposes a hook — phpmailer_init — that lets you modify the mailer object before an email is sent. This is where you inject your SMTP credentials. If you’re not familiar with how hooks work in WordPress, our WordPress Hooks Explained guide will bring you up to speed fast.
Add the following code to your theme’s functions.php file or, better yet, a custom functionality plugin. For help editing these files safely, check our guide on WordPress file permissions and our complete wp-config.php guide:
/**
* Configure WordPress SMTP via phpmailer_init hook
* AI Or Die Now — aiordienow.com
*
* Replace credentials with your actual SMTP provider details.
* Store sensitive credentials in wp-config.php as constants,
* not directly in functions.php.
*/
add_action( 'phpmailer_init', 'aiordienow_configure_smtp' );
function aiordienow_configure_smtp( $phpmailer ) {
$phpmailer->isSMTP();
$phpmailer->Host = 'smtp.yourmailprovider.com'; // e.g. smtp.brevo.com
$phpmailer->SMTPAuth = true;
$phpmailer->Port = 587; // TLS port — recommended
$phpmailer->SMTPSecure = PHPMailer\PHPMailer\PHPMailer::ENCRYPTION_STARTTLS;
$phpmailer->Username = 'your-smtp-username';
$phpmailer->Password = 'your-smtp-password-or-api-key';
$phpmailer->From = 'hello@yourdomain.com';
$phpmailer->FromName = 'Your Site Name';
}
For better security, don’t hardcode credentials in functions.php. Define them as constants in wp-config.php and reference them in the function:
// In wp-config.php — add ABOVE the "That's all, stop editing" line:
define( 'SMTP_HOST', 'smtp.yourmailprovider.com' );
define( 'SMTP_PORT', 587 );
define( 'SMTP_USER', 'your-smtp-username' );
define( 'SMTP_PASS', 'your-smtp-password-or-api-key' );
define( 'SMTP_FROM', 'hello@yourdomain.com' );
define( 'SMTP_NAME', 'Your Site Name' );
// In functions.php — updated to reference constants:
add_action( 'phpmailer_init', 'aiordienow_configure_smtp' );
function aiordienow_configure_smtp( $phpmailer ) {
$phpmailer->isSMTP();
$phpmailer->Host = SMTP_HOST;
$phpmailer->SMTPAuth = true;
$phpmailer->Port = SMTP_PORT;
$phpmailer->SMTPSecure = PHPMailer\PHPMailer\PHPMailer::ENCRYPTION_STARTTLS;
$phpmailer->Username = SMTP_USER;
$phpmailer->Password = SMTP_PASS;
$phpmailer->From = SMTP_FROM;
$phpmailer->FromName = SMTP_NAME;
}
This is the same pattern used in enterprise WordPress deployments. Storing credentials in wp-config.php keeps them out of the database and out of version control (assuming your .gitignore is properly configured). If you ever need to troubleshoot this code, our guide on how to debug WordPress will walk you through using WP_DEBUG and logging to identify exactly where things are failing.

Configuring SPF, DKIM, and DMARC for Maximum Deliverability
Here’s the part most tutorials skip, and it’s the reason people who thought they’d learned how to set up WordPress SMTP are still seeing emails land in spam. SMTP authentication tells receiving servers “this email is from a legitimate sender.” SPF, DKIM, and DMARC are the DNS records that tell receiving servers “this sender is authorized to send email on behalf of this domain.” Both are required for maximum deliverability.
SPF (Sender Policy Framework)
SPF is a DNS TXT record that lists which mail servers are authorized to send email from your domain. When setting up how to set up WordPress SMTP through Brevo, for example, Brevo will give you an SPF record to add to your domain’s DNS. It looks something like: v=spf1 include:spf.brevo.com ~all. Add this as a TXT record to your domain’s DNS through your registrar or hosting provider. Only have one SPF record — multiple SPF records are invalid.
DKIM (DomainKeys Identified Mail)
DKIM adds a cryptographic signature to every outgoing email — a detail often overlooked when people first learn how to set up WordPress SMTP. The receiving server checks the signature against a public key stored in your DNS. If they match, the email is confirmed as unaltered and from your domain. Your SMTP provider will generate a DKIM key pair and give you a TXT record to add to your DNS. This is a one-time setup with massive deliverability upside.
DMARC (Domain-based Message Authentication)
DMARC is the policy that tells receiving servers what to do when an email fails SPF or DKIM checks. A basic DMARC record looks like: v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com. Start with p=none (monitoring mode), check the reports, then graduate to p=quarantine and eventually p=reject once you’re confident your legitimate email is passing all checks.
🏴☠️ Pirate Tip
Google and Yahoo made SPF, DKIM, and DMARC effectively mandatory for bulk senders in early 2024. Even if you’re not sending bulk mail, setting these up is just good hygiene. Use a free tool like MXToolbox or Mail-Tester to verify your DNS records are configured correctly before calling your SMTP setup complete. One typo in a DKIM record and you’re back to 64% deliverability.

Setting Up SMTP for WooCommerce and Contact Forms
Once you know how to set up WordPress SMTP at the core level, all your WordPress email — including WooCommerce transactional emails and contact form notifications — automatically routes through SMTP. That’s because WooCommerce and virtually every reputable form plugin (Contact Form 7, WPForms, Gravity Forms, Fluent Forms) all call wp_mail() under the hood. When you configure SMTP to override how wp_mail() sends, every plugin benefits.
However, there are a few WooCommerce-specific things worth knowing when you’re thinking about how to set up WordPress SMTP for an e-commerce context:
- From Email Match — WooCommerce has its own “From” email setting under WooCommerce → Settings → Emails. Make sure this matches your SMTP configuration. WP Mail SMTP’s “Force From Email” feature handles this automatically if you enable it.
- Email Volume — High-traffic WooCommerce stores can generate thousands of emails daily. If you’re on a Brevo free plan (300/day), you’ll hit limits. Plan your SMTP provider choice around your expected volume, not just your current volume.
- Email Logging — WP Mail SMTP Pro and plugins like WooCommerce Email Log let you see every email that was attempted, delivered, or failed. Invaluable for debugging. Check our WordPress debugging guide for additional logging strategies.
- Custom Email Templates — This is WooCommerce-level customization and out of scope for this guide, but know that SMTP configuration doesn’t affect email design — just delivery. Your template work and SMTP work are independent.
For contact forms, the process is identical. Once you’ve completed how to set up WordPress SMTP at the plugin or code level, go to your contact form plugin’s settings and send a test submission. If the notification email arrives in your inbox, you’re done. If it doesn’t, use WP Mail SMTP’s email log to see exactly what happened.

Monitoring Email Deliverability and Keeping Your Sender Reputation Clean
Completing how to set up WordPress SMTP is not a “set it and forget it” deal if you care about long-term deliverability. Your sender reputation is a living thing — it improves with good sending habits and deteriorates when you send to bad addresses, get spam complaints, or suddenly spike your volume. Here’s how to keep your reputation healthy:
- Bounce Rate Under 2% — Hard bounces (invalid email addresses) damage your reputation fast. Clean your mailing lists regularly. If you’re collecting emails through WooCommerce or a form, implement double opt-in for newsletter subscribers.
- Spam Complaint Rate Under 0.1% — Gmail’s Postmaster Tools will show you your complaint rate. Stay below 0.1% at all costs. One bad campaign can tank your sender score for months.
- Consistent Sending Volume — Don’t go from 10 emails/day to 10,000 emails/day overnight. ISPs see sudden volume spikes as suspicious behavior. Warm up your sending volume gradually if you’re scaling up.
- Monitor Blacklists — Use MXToolbox’s Blacklist Check regularly to see if your sending domain or IP appears on any blacklists. If it does, you’ll need to contact the blacklist operator to request removal and fix whatever caused the listing.
- Use WP Mail SMTP’s Email Log — In the Pro version, every sent email is logged with delivery status. Reviewing this weekly takes five minutes and catches problems before they become disasters.
This level of diligence is part of the full answer to how to set up WordPress SMTP properly — not just the initial configuration, but the ongoing stewardship of your sending infrastructure. Think of it like keeping WordPress updated — you do the initial work, then you maintain it. Neglect either one and you’re asking for problems.

Troubleshooting Common WordPress SMTP Errors
Even when you follow every step of how to set up WordPress SMTP correctly, things go wrong. Here are the most common errors and what they actually mean:
“SMTP connect() failed”
This means WordPress can’t reach your SMTP server at all. Causes: wrong hostname, firewall blocking the port (common with port 587 on some shared hosts), or your hosting provider blocking outbound SMTP connections. Check with your host — many shared hosts block port 587 and require you to use port 465 or their own mail relay. Also verify the hostname is spelled correctly. One typo here and nothing works.
“SMTP ERROR: Password command failed”
Authentication failed. Either your username or password (or API key) is wrong. Double-check that you copied the credential correctly — no trailing spaces, correct case. For Gmail OAuth connections, this error usually means the Google API connection needs to be re-authorized. For Brevo and SendGrid, it often means you pasted the wrong API key or the key has been revoked.
“Could not instantiate mail function”
This is a PHP mail() error that shows up when SMTP isn’t configured yet — or when your SMTP configuration failed silently and WordPress fell back to PHP mail. If you see this after configuring SMTP, your phpmailer_init hook may not be firing, or the plugin may be deactivated. Enable WP_DEBUG as described in our WordPress debugging guide and check the error log for more detail.
Emails Arriving in Spam
You’ve completed how to set up WordPress SMTP, the test email sends successfully, but it lands in spam. This is almost always a DNS authentication issue — missing or misconfigured SPF, DKIM, or DMARC records. Run your domain through Mail-Tester (mail-tester.com) and it’ll give you a score out of 10 with specific recommendations. Aim for 9+.
Emails Not Sending from a Specific Plugin
Some plugins override the “from” address and send from a domain that doesn’t match your SMTP configuration. Use WP Mail SMTP’s “Force From Email” setting to ensure all emails go through the same authenticated from address regardless of what individual plugins request. This is one of those features that sounds minor but solves a lot of weird, intermittent delivery problems.

Advanced: Multi-Site, Staging, and Environment-Specific SMTP Configuration
If you’re running a WordPress multisite network or maintaining separate development, staging, and production environments, how to set up WordPress SMTP gets a layer more complex — but nothing unmanageable. Here’s the approach used by serious WordPress developers.
For development and staging environments, you absolutely do not want to send real emails to real users. The solution is to use a mail-catching service like Mailtrap in development. Mailtrap is a fake SMTP server — it catches all outgoing emails and displays them in a web interface without delivering them to anyone. Perfect for testing. Configure your staging environment’s SMTP to point at Mailtrap’s SMTP server, and production to point at your real provider. You can conditionally load SMTP settings using wp-config.php constants or a WordPress environment detection check.
// In wp-config.php — conditionally set SMTP host per environment:
if ( defined( 'WP_ENV' ) && WP_ENV === 'production' ) {
define( 'SMTP_HOST', 'smtp.brevo.com' );
define( 'SMTP_USER', 'your-production-smtp-user' );
define( 'SMTP_PASS', 'your-production-smtp-password' );
} else {
// Mailtrap for dev/staging — emails go nowhere real
define( 'SMTP_HOST', 'sandbox.smtp.mailtrap.io' );
define( 'SMTP_USER', 'your-mailtrap-user' );
define( 'SMTP_PASS', 'your-mailtrap-password' );
}
define( 'SMTP_PORT', 587 );
define( 'SMTP_FROM', 'hello@yourdomain.com' );
define( 'SMTP_NAME', 'Your Site Name' );
For WordPress Multisite, SMTP configuration in WP Mail SMTP applies network-wide by default when network-activated. Individual subsites can override settings if you allow it in the plugin’s network settings. For a code-based approach, the phpmailer_init hook fires for every site in the network, so a mu-plugin (must-use plugin) is the cleanest place to define SMTP configuration that applies universally. Learn more about WordPress architecture and how these pieces connect in our WordPress Database Structure guide and our overview of the WordPress REST API.

“Email deliverability is the invisible plumbing of every online business. Nobody thinks about it until the toilets back up — and by then, you’ve already lost customers.”
Frequently Asked Questions
What does SMTP stand for and why does WordPress need it?
SMTP stands for Simple Mail Transfer Protocol. It’s the standard method for sending email across the internet with proper authentication and encryption. WordPress needs it because the default PHP mail() function that powers wp_mail() sends email without authentication, which means receiving servers have no way to verify the sender is legitimate. Learning how to set up WordPress SMTP replaces this unreliable method with authenticated, encrypted email delivery that achieves 96%+ deliverability rates.
Is WP Mail SMTP the only plugin for WordPress SMTP configuration?
No. While WP Mail SMTP is the most popular with 4+ million active installs, alternatives include Post SMTP (formerly Postman), Fluent SMTP, and Easy WP SMTP. They all accomplish the same core task — overriding wp_mail() to use SMTP instead of PHP mail(). WP Mail SMTP has the widest provider support and best documentation, which is why most guides on how to set up WordPress SMTP recommend it as the default choice.
Can I use Gmail as my SMTP provider for WordPress?
Yes, but with caveats. Gmail allows up to 500 emails per day on free accounts and 2,000 per day on Google Workspace. For most small WordPress sites, that’s plenty. However, Gmail’s SMTP setup requires OAuth 2.0 authentication (not just a password), which makes the initial how to set up WordPress SMTP process slightly more complex. WP Mail SMTP has a built-in Gmail/Google Workspace integration that handles the OAuth flow for you.
What SMTP port should I use — 25, 465, or 587?
Use port 587 with TLS encryption. This is the current industry standard for authenticated SMTP submission. Port 25 is unencrypted and blocked by most ISPs and cloud providers. Port 465 uses SSL and works but is considered legacy. When figuring out how to set up WordPress SMTP, always start with port 587/TLS — only fall back to 465/SSL if your hosting provider specifically blocks 587.
Do I need SPF, DKIM, and DMARC records even for a small site?
Yes. Google and Yahoo made these effectively mandatory for all senders in 2024. Even a small WordPress site sending password reset emails and contact form notifications benefits from proper DNS authentication. Without SPF, DKIM, and DMARC, your emails are significantly more likely to land in spam — regardless of how well you configured your SMTP plugin. These DNS records are part of the complete answer to how to set up WordPress SMTP correctly.
Will configuring SMTP fix my WooCommerce order emails not sending?
In most cases, yes. WooCommerce uses WordPress’s wp_mail() function to send all transactional emails — order confirmations, shipping notifications, password resets, and more. When you complete how to set up WordPress SMTP, all wp_mail() calls automatically route through your SMTP provider. Make sure the “From Email” in WooCommerce settings matches your SMTP configuration, and enable “Force From Email” in WP Mail SMTP to prevent conflicts.
How do I test if my WordPress SMTP is working correctly?
Once you’ve completed how to set up WordPress SMTP, testing is essential. WP Mail SMTP includes a built-in Email Test tool under WP Mail SMTP → Tools → Email Test. Send a test email to an address you control, verify it arrives in the inbox (not spam), and check the email headers to confirm it was sent via your SMTP provider. For a more thorough test, use mail-tester.com — send a test email to their generated address and they’ll score your setup out of 10, flagging any issues with SPF, DKIM, DMARC, or content. Aim for 9 or higher.
Is the code method better than using a plugin for WordPress SMTP?
It depends on your skill level and use case. The code method (using the phpmailer_init hook) is lighter — no extra plugin, no database entries, and full control. But it requires you to manage credentials securely and debug issues manually. The plugin method is easier to configure, includes email logging, test tools, and provider-specific integrations. For most site owners learning how to set up WordPress SMTP for the first time, the plugin approach is the right call. Developers managing multiple sites or those who want minimal plugin footprint should consider the code method.
⚓ Pirate Verdict
Knowing how to set up WordPress SMTP is not optional — it’s table stakes for running a WordPress site that actually communicates with its users. The default PHP mail() setup is broken by design, and every day you leave it unconfigured is a day you’re losing password reset emails, contact form submissions, and WooCommerce order confirmations into the void.
The fix takes 15 minutes. Install WP Mail SMTP, connect a free Brevo account, add your SPF and DKIM records, send a test email, and you’re done. That’s it. That’s the entire process to go from 64% deliverability to 96%+.
Stop losing emails. Fix your SMTP. It’s the single highest-ROI 15 minutes you’ll spend on your WordPress site this month. 🏴☠️
For more on building a fast, secure, well-configured WordPress site, explore the full AI Or Die Now Arsenal — tools and resources built for people who ship, not people who subscribe.