Send WordPress Email With SMTP: Free Setup Guide
Send WordPress email with SMTP for free: plugin and code setup, web host and Gmail settings, app passwords, test steps, error fixes and domain record tips.

Last updated December 5, 2026
To send WordPress email with SMTP, install a free SMTP plugin such as FluentSMTP or WP Mail SMTP. Then enter your email provider’s SMTP host, port, username and password, and send a test email.
SMTP (Simple Mail Transfer Protocol) sends mail through a real, signed-in mailbox. That stops many emails from landing in spam or vanishing.
Key Takeaways
- By default, WordPress sends mail through PHP on your web server, with no mailbox login.
- Most email hosts use port 465 with SSL or port 587 with TLS.
- Personal Gmail needs 2-Step Verification and an app password for SMTP.
- Google Workspace accounts should connect with Sign in with Google instead.
- Set up Sender Policy Framework (SPF) or DomainKeys Identified Mail (DKIM) records so Gmail trusts your mail.
WordPress SMTP setup helper
Pick your email provider and how you want to set it up. The tool shows the steps and the settings.
Digieh tool. Settings from Google and WordPress developer pages, read December 5, 2026.
Why Is WordPress Not Sending Email?
WordPress sends every email through the wp_mail() function. Out of the box, it hands mail to PHP on your server.
Those emails are not signed in to any mailbox. Gmail and Outlook may send them to spam or reject them. Some hosts also limit or block server mail.
The fix is to route wp_mail() through SMTP. Your site then logs in to a real mailbox, like a mail app on your phone does.
Source: WP Mail SMTP plugin page and WordPress developer reference for wp_mail(), read December 5, 2026.
What SMTP Settings Do You Need?
| Provider | SMTP host | Port and encryption | Password |
|---|---|---|---|
| Personal Gmail | smtp.gmail.com | 465 SSL, or 587 TLS | App password |
| Google Workspace | Use the plugin Google mailer | Handled by Google sign-in | None stored |
| Your web host email | From your host email dashboard | 465 SSL or 587 TLS | Mailbox password |
Source: Google Workspace Admin Help and WordPress phpmailer_init reference, read December 5, 2026.
The username is almost always your full email address. Find your settings in your host’s email dashboard if you are not sure.
How Do You Set Up SMTP With a Free Plugin?
A plugin is the easiest route. Both of these are free on WordPress.org.
| Plugin | Active installs | Free email log | Notes |
|---|---|---|---|
| WP Mail SMTP | 4+ million | No, Pro only | Free Other SMTP and Gmail options |
| FluentSMTP | 700,000+ | Yes | No paid version, fallback connection included |
Source: WP Mail SMTP and FluentSMTP pages on WordPress.org, read December 5, 2026.
- Go to Plugins, then Add New Plugin, and search for the plugin name.
- Install and activate it.
- Open its settings and add a new connection.
- Pick Other SMTP, or your provider if it is listed.
- Enter the host, port, encryption, username and password from the table above.
- Set the From email to the same address you sign in with.
- Save, then send a test email from the plugin.
How Do You Use Gmail SMTP With WordPress?
For a personal Gmail account, use smtp.gmail.com with an app password. Google says an app password is a 16-digit passcode for apps that cannot use Sign in with Google.
- App passwords only work when 2-Step Verification is on.
- Google cancels your app passwords when you change your Google password.
- Google says app passwords are not recommended where Sign in with Google is offered.
Source: Google Account Help, Sign in with app passwords, read December 5, 2026.
For a work Google Workspace account, Google ended username and password sign-in for apps on May 1, 2025. Use the Google mailer in FluentSMTP or WP Mail SMTP, which signs in with Google.
Source: Google Workspace Admin Help, Send email from a printer, scanner, or app, read December 5, 2026.
That is plenty for most small sites, but not for newsletters.
Free updates
Join the Digieh list
Be the first to know when our weekly brief launches.
No spam. Unsubscribe anytime. Read our Privacy Policy.
How Do You Set Up SMTP Without a Plugin?
Developers can use the phpmailer_init hook. WordPress fires it before each email, so you can switch the mailer to SMTP.
First, add your login to wp-config.php, above the line that says to stop editing.
define( 'DGH_SMTP_HOST', 'smtp.yourhost.com' );
define( 'DGH_SMTP_USER', 'you@yourdomain.com' );
define( 'DGH_SMTP_PASS', 'your-mailbox-password' );Then add this snippet with a code snippets plugin or a must-use plugin.
add_action( 'phpmailer_init', function ( $phpmailer ) {
$phpmailer->isSMTP();
$phpmailer->Host = DGH_SMTP_HOST;
$phpmailer->SMTPAuth = true;
$phpmailer->Port = 465;
$phpmailer->SMTPSecure = 'ssl'; // use 'tls' with port 587
$phpmailer->Username = DGH_SMTP_USER;
$phpmailer->Password = DGH_SMTP_PASS;
$phpmailer->From = DGH_SMTP_USER;
$phpmailer->FromName = get_bloginfo( 'name' );
} );Keeping the password in wp-config.php keeps it out of the database. A typo in that file can take the site down, so back up first.
How Do You Test WordPress Email?
- Use the test email page in your SMTP plugin.
- Or open the login page, click Lost your password, and request a reset email.
- Check the inbox, then the spam folder.
- If you use WooCommerce, place a test order and check the order email.
A test that arrives in seconds means SMTP works. If nothing arrives, check the plugin log or the error message it shows.
What Do Common SMTP Errors Mean?
| Error | Likely cause | Fix |
|---|---|---|
| SMTP connect() failed | Wrong host or port, or the port is blocked | Check the host, then try the other port |
| Authentication failed | Wrong username or password | Use the full email address and reset the password |
| Relay access denied | Sender not signed in for that domain | Turn on authentication and send from the signed-in address |
| Emails missing with PHP mail() | Host limit on server mail reached | Send through SMTP instead |
Many shared hosts also cap how many emails PHP mail() can send each hour or day. SMTP through your mailbox avoids most of those limits.
Other errors after a change? See our guides to the WordPress critical error and loopback request failed.
Why Do Domain Email Records Matter?
SMTP proves your site can log in. Domain records prove your domain allowed that mail. Both help you reach the inbox.
Google says all senders to Gmail must set up Sender Policy Framework (SPF) or DomainKeys Identified Mail (DKIM).
Senders of more than 5,000 messages a day need both. They also need Domain-based Message Authentication, Reporting and Conformance (DMARC).
Source: Google email sender guidelines, read December 5, 2026.
Most email hosts add these DNS records for you, or show them in the email dashboard. Check them once after you connect a domain. Our guide to connecting a domain to hosting covers DNS basics.
Which Option Should You Choose?
- Pick FluentSMTP if you want free email logs and a backup connection.
- Pick WP Mail SMTP if you want a guided setup wizard.
- Pick the code snippet if you manage the site yourself and want no extra plugin.
- Use one SMTP plugin only. Two can fight over wp_mail().
Which email will your site send from?
- My web host email
- Personal Gmail
- Google Workspace
- Another provider
- Not sure
Test Yourself
What does Google require before you can create an app password?
- A paid plan
- 2-Step Verification
- A custom domain
Google says app passwords only work on accounts with 2-Step Verification turned on.
Which WordPress hook lets you switch wp_mail() to SMTP in code?
- init
- phpmailer_init
- wp_head
The phpmailer_init action fires before WordPress sends each email.
Frequently Asked Questions
Does WordPress have built-in SMTP settings?
No. WordPress has no SMTP screen. You need a plugin or a small code snippet using the phpmailer_init hook.
Which port should I use for SMTP?
Use 465 with SSL or 587 with TLS. Google supports either one, and most hosts do too.
Is WP Mail SMTP free?
Yes, the core plugin is free, including Other SMTP. Email logs are in the Pro version.
Why do my WordPress emails go to spam?
They are often sent without a mailbox login or domain records. Use SMTP and set up Sender Policy Framework (SPF) or DomainKeys Identified Mail (DKIM).
Conclusion
Install a free SMTP plugin, enter your provider’s settings and send a test email. Add domain email records, and your WordPress emails will reach the inbox far more often.
Editor’s Note
This guide is accurate as of December 5, 2026. Settings come from Google, WordPress.org and the WordPress developer reference. Plugin screens can change, so follow the plugin’s own setup guide if a label looks different.
Spot an error in this article? Please contact us at support@digieh.com or read our Corrections Policy.
Keep exploring
Your next read is waiting
1AI & TechHow to Install WordPress on Localhost for Free8 min read
2Home & KitchenLG Range Error Codes: Meanings and Reset Steps7 min read
3AI & TechBlocked Due to Unauthorized Request (401): Fix Guide7 min read
4AI & TechInvalid JSON Response Error in WordPress: 8 Fixes7 min read
5AI & TechEtsy Fee Calculator: What Etsy Takes Per Sale7 min read
6AI & Tech413 Request Entity Too Large Error: WordPress Fix7 min readFound this useful?












