Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared Managed Cloud India
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Best lists Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Setup & site building · Guide

How to Set Up SMTP in WordPress So Emails Arrive

Short answer

WordPress sends mail with the PHP mail function by default, and many hosts do not handle it well, so messages go missing or land in spam. Install WP Mail SMTP, pick a mailer such as SendLayer, Brevo or Gmail, enter the credentials in the setup wizard, and send a test email to confirm delivery.

Key takeaways

  • WordPress sends mail with PHP mail by default, and many hosts do not handle it well.
  • WP Mail SMTP reconfigures wp_mail() to send through an authenticated mailer.
  • More than 4 million websites use WP Mail SMTP, with a 4.8 out of 5 rating.
  • Brevo gives 300 free emails per day, and SMTP.com gives 50,000 free emails in 30 days.
  • Gmail SMTP needs an app password, not your normal Gmail password.
  • Send a test email after setup, and check SPF, DKIM and DMARC too.

What is SMTP in WordPress?

SMTP is the standard way to send email with authentication, and it replaces the default route WordPress uses.

SMTP stands for Simple Mail Transfer Protocol. It is the industry standard for sending email, and it adds authentication to each message so the receiving server can trust the sender.

By default, WordPress sends email with the PHP mail() function. WPForms' documentation explains that many hosting servers are not set up to use that function, so messages fail or land in spam.

An SMTP plugin changes how WordPress sends mail. WP Mail SMTP's plugin page says it reconfigures the wp_mail() function to use proper SMTP host credentials or a mail provider.

The result is the same emails, sent through an authenticated connection. Password resets, order notices and form alerts reach the inbox instead of vanishing.

Why do WordPress emails go missing?

WordPress emails go missing because the default PHP mail route has no authentication, so receiving servers distrust it.

Email providers check each incoming message to decide whether to deliver it, send it to spam or block it. WPForms' documentation notes that one check is whether the email comes from the same place it claims to come from.

A message sent by PHP mail() often fails that check. It may carry a From address that does not match the server that sent it, and the receiving server has no way to confirm the sender.

Hosts add to the problem. Some shared hosts block the ports SMTP needs, and some do not set up PHP mail at all, so the message never leaves the server.

That is why a contact form can look fine while its notices never arrive. The form works, the email route does not.

What do you need before you set up SMTP?

You need an SMTP plugin, an account with a sending provider, and a From address at your own domain.

First, pick the plugin. WP Mail SMTP is the most used choice: its WordPress.org page says more than 4 million websites use it, and it holds a 4.8 out of 5 rating from 5,217 reviews, as of November 2026.

Second, pick a mailer. A mailer is the sending service the plugin connects to, such as SendLayer, SMTP.com, Brevo, Gmail or your host's SMTP server.

Third, set up the mailer account before you touch WordPress. Most mailers ask you to confirm that you own your domain, and some need DNS records added before they will send for you.

Fourth, choose the From address. Most mailers require it to be at the domain you authenticated, so use an address such as [email protected], not a free mailbox address.

Which SMTP plugin and mailer should you pick?

Pick WP Mail SMTP with a transactional mailer, and use Other SMTP only when your provider has no named mailer.

The free version of WP Mail SMTP lists 18 mailers on its plugin page, including SendLayer, SMTP.com, Brevo, Gmail, Mailgun, Postmark, SendGrid, SMTP2GO and Other SMTP. Three of them, Microsoft Outlook, Amazon SES and Zoho Mail, need the paid Pro version.

For most small sites, one of the three recommended mailers fits best. The plugin page marks SendLayer, SMTP.com and Brevo as recommended.

The free allowances help you choose. WP Mail SMTP's plugin page says Brevo gives you 300 free emails per day, SMTP.com gives 50,000 free emails in your first 30 days, and SendLayer lets you send hundreds of emails for free when you sign up for a trial.

Gmail suits a site that already runs on Google Workspace. It sends through your Google account, but it is not built for bulk mail, so keep it for notices and forms.

Other SMTP fits any provider that gives you a host, port, username and password. Use it for your host's mail server or a provider with no named option.

How do you install WP Mail SMTP?

Install WP Mail SMTP from the plugin screen, then open its settings to start the setup wizard.

Go to Plugins > Add New Plugin and search for “WP Mail SMTP”. Click Install Now, then Activate. The free version is called WP Mail SMTP Lite.

WPForms' documentation walks through the same steps, and notes that the paid Pro version adds mailers, email logs, backup connections and alerts.

After activation, a WP Mail SMTP item appears in the admin menu. Open WP Mail SMTP > Settings and click Launch Setup Wizard.

Do not install a second SMTP plugin at the same time. Two plugins that both control outgoing mail can overwrite each other's settings, so pick one and remove the other.

How do you connect a mailer with the setup wizard?

Pick the mailer in the wizard, enter its credentials, set the From address, and save.

Click Let's Get Started in the wizard, then select the mailer you chose. For the example in WPForms' documentation, the SendLayer mailer is used.

The next screen depends on the mailer. For most of them, you will need to provide an API key or similar credentials to connect your site to your account.

The SendLayer mailer requires you to authorize your domain before connecting it to WP Mail SMTP. Check the mailer's own documentation for that step before you start the wizard.

Then set the From Name and From Email. WPForms' documentation says most mailers require the From Email to be at the domain you authenticated in your account.

Click Save and Continue after each screen. The wizard then offers Pro features such as email logs, which you can skip if you use the free version.

How do you set up SMTP with Gmail?

Connect WP Mail SMTP to Gmail with the Google mailer, using OAuth or an app password.

In the wizard, select Google / Gmail as the mailer. The Pro version offers a one-click setup, while the free version connects through a Gmail API app you create in Google Cloud Console, as WPForms' Gmail guide explains.

For the Other SMTP route, the settings are fixed. Use smtp.gmail.com as the host, port 587 with TLS, or port 465 with SSL, and your full Gmail address as the username.

Do not use your normal Gmail password. Google ended support for less secure apps, so SMTP needs an app password or OAuth. An app password is a 16-character code Google generates after you turn on 2-Step Verification.

Set the From Email to the Gmail address you connected. If the From address does not match the account, Gmail will reject the message or rewrite the sender.

How do you set up Other SMTP with any provider?

Enter the provider's host, port, encryption, username and password under the Other SMTP mailer.

In WP Mail SMTP > Settings, choose Other SMTP as the mailer. Fill in the fields your provider gave you, using the values below as a guide.

FieldWhat to enter
SMTP HostYour provider's SMTP server hostname
EncryptionTLS for port 587, or SSL for port 465
SMTP PortUsually 587
AuthenticationOn
SMTP UsernameUsually your full email address
SMTP PasswordThe SMTP password or app password

Port 587 is the standard submission port and normally uses TLS through STARTTLS. Port 465 starts with implicit TLS, which many plugins label SSL.

Turn on Force From Email so forms cannot substitute a visitor's address as the sender. Put the visitor's address in the Reply-To field instead, so you can still answer them.

Also turn on Return-Path and set it to match the From Email. That sends bounce notices to your own mailbox, so you learn when a message fails.

How do you send a test email and confirm it works?

Send a test email from WP Mail SMTP, then check that it arrives and passes authentication.

At the end of the setup wizard, WP Mail SMTP checks the connection and shows a success message if it works. WPForms' documentation says that if you see the success message, your form notices should deliver properly.

For a second check, go to WP Mail SMTP > Tools > Email Test and click Send Email. You should see another success message and receive the email.

Open the test email and check its headers. The message should pass SPF, DKIM and DMARC checks for your domain. Our guide to setting up SPF, DKIM and DMARC explains those records.

Then send a real form entry, a password reset and a WooCommerce order notice if you run a store. A test email proves the connection works, while a real message proves the forms use it.

What do you do when SMTP still fails?

Match the error message to its cause, and check ports, credentials and the From address first.

“Could Not Open Socket” usually means the host is blocking the ports SMTP needs. WPForms' documentation says a firewall is often the cause, and you should ask the host to open the port you need.

“SMTP connect() failed” means the connection to the SMTP host failed. Double-check the host, port, encryption and password, because one wrong field is the usual cause.

“535 Incorrect authentication data” means the username or password was rejected. Check the credentials, and for Gmail confirm you used an app password, not the account password.

A warning that the sender address does not match your website's domain means the From Email uses a different domain than the site. Change it to an address at your own domain.

If the test email works but form notices still fail, the problem is in the form. Our guide to fixing WordPress not sending emails covers the general checks.

Our guide to fixing contact forms that do not send covers the form-side checks.

What mistakes should you avoid?

Avoid the five mistakes that cause most SMTP failures.

First, do not use a free mailbox address as the From Email. Mailers require the From address to match the domain you authenticated, and a mismatch gets the message blocked.

Second, do not use your normal Gmail password. Google requires an app password or OAuth for SMTP, and the account password will fail.

Third, do not install two SMTP plugins. Only one should control outgoing mail, or their settings will fight each other.

Fourth, do not skip the test email. A setup that looks right can still fail on ports or credentials, and the test is the only proof it works.

Fifth, do not forget DNS authentication. SPF, DKIM and DMARC records tell receiving servers your mail is genuine, and without them even authenticated SMTP can land in spam.

Frequently asked questions

What is the difference between SMTP and PHP mail in WordPress?

SMTP routes WordPress mail through an authenticated mail server, so receiving servers can confirm the sender. PHP mail has no authentication, so providers often treat its messages as spam or block them. That is the main reason WordPress emails go missing.

Is the free version of WP Mail SMTP enough?

Yes, for low volume sites. The free version of WP Mail SMTP connects to 15 mailers at no cost, including Gmail, Brevo, SendLayer and Mailgun. Paid Pro adds email logs, backup connections, alerts and extra mailers such as Amazon SES and Outlook.

Why does Gmail reject my SMTP password?

Google ended support for less secure apps, so your normal Gmail password will not work for SMTP. Turn on 2-Step Verification, generate a 16-character app password in your Google account, and use that as the SMTP password instead.

How do I know SMTP is working after setup?

First, send a test email from WP Mail SMTP, Tools, Email Test, and confirm it arrives. Then send a real form entry and a password reset. If the test works but forms fail, check the form notification settings, especially the From Email address.

Which SMTP port should I use, 587 or 465?

Use port 587 with TLS for most providers, and port 465 with SSL when the provider asks for it. Port 587 is the standard submission port and uses STARTTLS. Port 465 starts with implicit TLS. Using SSL on port 587 is a common error.

Can I use two SMTP plugins on the same site?

Yes, but only as a backup plan. Keep one plugin active for sending, and remove or deactivate the other. Two SMTP plugins can overwrite each other's settings, which causes confusing failures that are hard to trace.

Sources

  1. How to Set Up SMTP Using the WP Mail SMTP Plugin WPForms
  2. WP Mail SMTP by WPForms WordPress.org
  3. How to Set Up WP Mail SMTP With Gmail WPForms
  4. Send email from a printer, scanner, or app Google
  5. WP Mail SMTP WP Mail SMTP

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

WPLegible editors

Researched from the primary sources listed above and checked against our editorial rules. About the site · How we test