How to use SMTP with WordPress

how to use wordpress smtp

We’re going to answer a few questions around configuring SMTP for WordPress including:

  1. What is SMTP and how does it apply to WordPress
  2. Why and when do you need to use SMTP
  3. How do I use SMTP with WordPress
  4. What’s the difference between an API connection and an SMTP connection

What is SMTP and how does it apply to WordPress?

SMTP (simple mail transport protocol) is the method that email servers use to talk to each other in order to relay messages from one server to the other. If you’re sending a message, then there’s usually at least two SMTP servers involved: your mail provider’s server that your mail app connects to in order to initiate the sending process, and the recipient’s email provider’s SMTP server.

WordPress by default will send messages using unauthenticated SMTP on the same server that your website resides, but that connection doesn’t send *through* your actual email address (using its username and password) and so it misses some or all of the necessary authentication systems to prove to the recipient that the message is indeed valid and from you.

Why do you need to use authenticated SMTP?

Years ago unauthenticated SMTP wasn’t a big deal, but in recent years the increase of spam has resulted in three dominant mail authentication systems that work together to ensure the sender of the message has not been falsified. Together, they ensure that the email is not spam and that the sender is correct, but these authentication systems can only work smoothly if all messages sent from your email address are actually sent using the right SMTP server.

Because of these mail authentication systems, mail sent from your WordPress website will likely either not reach the recipient(s), or will be filtered to spam unless you begin sending the messages using your mail provider’s server, and authenticated SMTP is the way to do that.

How do I use authenticated SMTP with WordPress?

WordPress does not come with authenticated SMTP connectivity out of the box, but there are a couple plugins to select from that provide this functionality:

  • The WP SMTP plugin (By WPOmnia) will allow you to enter the SMTP details for your mail provider so that all messages sent via WordPress will now go through their servers rather than being sent locally from the server where your website is hosted. It also comes with pre-configured values for Gmail and other common providers.
  • The WP Mail SMTP plugin offers the same functionality but also has direct API connectivity to Google Workspace and Microsoft365, though the Microsoft one requires their paid Pro version.

What’s the difference between an SMTP and API connection?

In this instance, an API connection allows your website to connect to your email provider’s mail server without having to save a username and password in WordPress. This is more secure than a typical SMTP connection, and so you may wish to use WP Mail SMTP in order to obtain this functionality, though keep in mind it is only available for Google Workspace unless you pay for their Pro version.

Where do I get the SMTP connection details?

Tip: you won’t need these if you opt to use an API connection, though you will have to login to your mail provider account to set up the initial API connection.

These must be obtained from your mail provider. They will consist of:

  1. A server hostname like smtp.googlemail.com
  2. A port, which is typically 587 but could also be 465 or (less common these days) 25.
  3. TLS or SSL usually must be enabled.
  4. The username: which is your email address
  5. The password: the same one you use to login to access your email at webmail

Once you have installed and activated one of the above noted plugins, connected it to your mail provider (either via API or standard SMTP settings), all emails from WordPress should be flowing smoothly.

If you continue to experience any problems with email deliverability, you should check to ensure that your mail authentication records are set up correctly and that your forms are configured correctly (for those using a form builder).

Posted in

Jordan Schelew

Jordan has been working with computers, security, and network systems since the 90s and is a managing partner at Websavers Inc. As a founder of the company, he's been in the web tech space for over 15 years.
WS-Logo-only-image-large

About Websavers

Websavers provides web services like Canadian WordPress Hosting and VPS Hosting to customers all over the globe, from hometown Halifax, CA to Auckland, NZ.

If this article helped you, our web services surely will as well! We might just be the perfect fit for you.

Leave a Comment