By default, a WordPress website sends email using the built-in functions of the programming language it was built with.  This is the Mail function of PHP.  Unfortunately, email sent this way look suspect to a receiving email server.  Sometimes the domain name of the website and the domain name of the email address aren’t the same.  The mail culprit is that email servers want email to be send from the email server for that domain which isn’t the website server.

To combat spam, email servers have added a number of techniques to increase the trust factor before accepting incoming emails.  When these methods are configured, email servers accept email and not mark it as spam.  A WordPress website doesn’t meet these checks so the email it sends is marked as spam or even just deleted outright.

The way to overcome this is to use the same protocol that email server use which is SMTP.  SMTP stands for Simple Mail Transfer Protocol and used by all email servers to send email.  The way to improve sending email from a WordPress website is to integrate with either the company’s email server or use an email relaying service.

The way to connect to these services is to use a WordPress plugin.  I recommend WP Mail SMTP.  The plugin allows you to connect your WordPress website to a number of different email services.  The two most common are Google Gmail or Microsoft Outlook.  Once these services are connected, the WordPress website will send an outbound email to them and then they will forward it on.  Since these are full email servers, your email will be reliably sent to its destination.

How to send email reliably from WordPress website transcript

Sending email from WordPress website

Let’s talk about how to send email reliably from a WordPress website. Let’s talk about sending an email from a WordPress website. Well, first, we got to kind of set some parameters for what we mean by sending email from WordPress website. So first, I don’t mean if you have a link on your website using the mail to link and somebody clicks on that link and sends email, what that actually does is cause a their default email program to be triggered. And then they just compose an email and hit Send and it’s their email server, excuse me their email client sending the email. So that’s not what I’m talking about, actually talking about WordPress itself sending email.

Default method WordPress sends email

And the reason this is happens is because the server needs functions to send emails, so by default, WordPress is designed to show webpages show content, things like that. And it does have some functions to send email. So it the web server, WordPress is actually sending an email. The default method that WordPress uses is the PHP mail function. What this basically means is WordPress is built on a programming language called PHP. In the programming language, there is a function or feature or command that actually called mail that actually sends emails. So WordPress simply uses this method to actually send email.

Email sending issues

There are some issues though, with using this default method one, the email kind of moth looks like spam. It’s coming from a WordPress website or in effect your web site. Hopefully it has the same domain name that you’re using for the different emails may or may not. But really, the key issue that’s coming up is the way that email works is an email server in order for two different email servers to exchange email, they have to actually look up to figure out where they’re supposed to send email to. And this uses the DNS the domain name service to learn where the friendly name, ie the domain name leads to the IP address, the actual thing that a computer needs to connect to. There is a subset of the DMX records called MX records, which are just short for email exchanger. So it’s just a subset. So when an email server wants to send an email, looks up the MX records for a specific domain and figures out where to send it. So email servers are supposed to do this. On the other hand websites, they don’t do any of this, they just simply send the email so they still do the lookup. But when the other server sees that they’re like, well, you’re not where I think you should be. So this is why a lot of times this email can look like spam and sometimes will be rejected outright.

Solution to email sending

So what’s the solution to this? Well, it’s basically use the same protocol that email servers use, which is SMTP, which stands for Simple Mail Transfer Protocol, this is how to email servers would actually communicate back and forth. There are a couple different ways that a WordPress website can use this one is you can actually set up your WordPress website to use your company email server, and that would allow it to basically hand off the message before it wants to send so instead of the WordPress website, sending it it actually gives it to your company email server. If you don’t have that, or you need another method, you can still use smtp. But basically, you have to set up what’s called an email relay. And these are specific servers that just simply send email, but don’t hold email, like an email server for your company, what it also holds your mailbox where you can actually send that so both of these are options, but they still use this SMTP protocol. So the WordPress website no longer just sends it using that PHP mail function. It actually hands it off you to one of these two things and then it actually sends it via smtp.

Use WP Mail SMTP

So how do we configure our WordPress website to do this? Well, fortunately, there’s a plugin like there is for everything. And what I recommend is actually called WP mail smtp. So you just install this WordPress plugin does have free options. There also are paid options, but it handles a multitude of different email server options and email relay options.

Demonstration of sending email reliably from a WordPress website.

So let’s go ahead and do a demo of how to send email reliably from a WordPress website. First, I’ll just show you some tests so you can see kind of how it works without any changes. Then we’ll go ahead and install the WP mail SMTP plugin, show you some settings in there. And then finally we’ll start the setup wizard to help show you how you’d actually configure that plug in to send email from your WordPress website. Okay, let’s go ahead and go through a demonstration of how to configure WordPress to send email reliably.

Website contact page form

So, the first thing we do is log into our WordPress website, which I’ve already done here. What I’d like to do first is is show you how a contact form by Fall sends email. So just to re familiarize you with how this would be set up, we’re already in our dashboard for WordPress. But so let’s go ahead and go back to the home set up the home page. And then we’ll go to our contact page. And you’ll see our form here, which has information about name, email, and message and submit. But let’s go back into our dashboard and look to determine upon submission of this form, where would the email go. So in this case, I’m using the ninja forms plugin to handle that form that we see there on the contact page. We’ll see we have our one contact me form here. So we’ll go ahead and edit that to look at the different settings. So we have in Ninja forms this email and actions, and we’ll see that there’s a couple of different ones here we have an email confirmation and an email notification. The notification is the one that comes to us email confirmation is the one that goes back to the person that submitted. So we’ll go ahead and look at the email notification here. And we see it sent to system admin email. So in this case, this is set to whatever the email is of the WordPress website.

WordPress administration email address

So let’s go double check where that set downs we backed out of our form. We’ll go down here to settings and general. And we’ll get in the general sense. And we’ll see this is going to the administrative email for our WordPress website. So how services company wide@gmail.com. And I’ve already logged into that gmail account here. Okay, so we have everything set up.

Send test email

So we’re going to go ahead and back to visit the site. Go to our contact page. And go ahead and fill out the form. So just to kind of keep this clear, we’ll just use some temporary data. So we’ll call this for the name just test one, the email, we’ll go ahead and use that same email just so we can see how that both messages come in, of course, normally UNC both messages, because one would go back to the person that is sending it. And for the message again, it was called test one so that we know everything sir, go ahead and submit. And we get our notification or excuse me success message the email was set. Okay, we’ll go into our gmail account, go ahead and check messages. And we don’t see it however, you go down here to spam. Aha, there they are, we’ll see here are two messages. So new message from test one, that is the one that comes to us. Submission confirmation, that’s the one that goes back to the person who submitted it. So we’ll go in just look at that one real quick.

One thing we’ll notice right here is that Gmail is telling us we can verify it. So this is actually the first indication of again, a problem that are were that email sent from our WordPress website isn’t actually going very arrived by itself. First I went into spam within Gmail. And second, we get this warning that it could be what it’s called a phishing, that it doesn’t look like it’s coming from the one that it’s sent to. We’ll go ahead and go back, we’ll look at the new message from test one. Again, we’ll see the same information here. So this is basically the problem that we’re having, which is the the messages are unreliable in the sense they went to spam and we’re getting warning messages which we would prefer that our messages come through loud and clear.

Install WP Mail SMTP

So what we’re going to do is improve the email deliverability here of actually using something called a plugin that uses the protocol SMTP or Simple Mail Transfer Protocol. So let’s go ahead and go back into our WordPress site. Go into dashboard. And we’ll go into install a new plugin. We do a search for w p, male s. m MTP and here’s the one that comes up. So we’ll go ahead and install that. Okay, the plugin has been installed we’ll go and activate it and one outcome automatically to the SMTP setup wizard. But I’d like to go back and just sort of show you what has changed in WordPress before we walk through the wizard. So I’m just going to click this one go back to dashboard. Okay, so it has already come to the WP mail SMTP commands that are here, this is just clicking the first one. So we’ll see that there are a couple of different options. One, we’re using the lite version, we’ll kind of come back to this and look at options for upgrading. But let’s just see what again comes out of the default.

WP Mail SMTP settings

In the General tab, we see again, a license. Again, it says we’re just running the might one. Here’s the setup wizard, which we’ll go back to. And this one actually helps us set up some of the common themes. So now for the from email, it just took it from the system, email, within WordPress, does have this option to force the from email, we can set the from name, in this case it already pre populate with our website name, we could change that same thing with force, something called the return path. And then this is the real key difference here, which is the mailers, and we’ll go over that in second. And default and save settings and some additional information about the paid version. Okay, so we’ve kind of just briefly gone over that. There are a couple other tabs up here.

Email test using WP Mail SMTP

Email test is a great one for confirming everything’s working. So let’s go ahead and do that next. So by default, it’s going to use the default one. So we’re just going to send an email message to our gmail account set as HTML. And we’ll hit Send Email. And it says the test email has been sent six way please check your inbox, make sure it’s delivered. So close that. And now we’ll go back into our gmail account because that’s where we send it to. And we’ll go back up to the inbox, nothing here yet, go and refresh this view. Still nothing. But again, we’ll go down and check spam. and refresh that. Let’s see there are tests menchi, just came in. So they’re different subject line here, go and open that up. It shows some pictures missing again, because it again, isn’t sure. But again, we got our congratulations, we got our test message. Okay, so that’s great. So now we’ll go back in here. So we looked at the email test feature. So now we don’t have to submit a form just to test it, we can do that.

Other settings

Or a couple other things here. But the email log is part of the upgrade the paid the paid version. Same with email controls. And then miscellaneous just has a few things that you can do if for some reason you wanted to stop using it for different things or hide announcements and things like that. Okay, we’ll go ahead and go back to the general one.

Email mailers available in WP Mail SMTP

So what we really want to look at here are these different mailer options, so we kind of scroll down here, we’ll get into this mailer section here. So by default, it’s using PHP. So this is the WordPress native emailing function. There are other ones. So the ones that probably you’re going to be most familiar with are Gmail, which is, of course, my Google’s free email program, Outlook, which is Microsoft’s free email program. The other ones that are listed here are either related to email relays. So for example, mailgun sendgrid, fill into that, a couple other services SMTP comm and send in blue. If for some reason you’re using Amazon’s web services, there’s an option there. And if you’re using a CRM, different tool called Zoho, and then ultimately you can actually pick other smtps.

So let’s just actually pick on that one real quick to see what happens. So when you click on different options here, then the information changes. So if you’re doing any email service supports SMTP, you’re going to need to put in some common information. So for example, the hostname, how you’re using encryption, what port it’s using, and why they’re not you’re using a authentication and username password. However, if you’re picking, say, for example, Gmail, it’ll go through and explain different things here of how to set up all this information called a client ID and a client secret and things like that. And if you’re using Microsoft Outlook, oh, Microsoft Outlook is grayed out. Why is that? Ah, unfortunately, to use that Microsoft Outlook, you must upgrade to the paid version. And again, this is just how plugins work. It is free, but in order to use some features, they do require you to purchase it. I’ll go ahead and Switch back to nine here. So again, those are the different mailers that are are available for you.

WP Mail SMTP Setup Wizard

But to make this a little bit easier, let’s go ahead and walk through the setup wizard. So you can kind of see how that works. So go ahead and launch the setup wizard. Changes won’t be saved because I was clicking around there. So just save settings. And again, it’s just warning us that this is not the recommended way to use the default one, but we’re just doing a test. Okay, so now we’ll go ahead and launch setup wizard says, Welcome, let’s get started. So instead of having to go through all settings, basically, this will just walk you through the different options. Here, it’s a little bit better, where it shows you which options are only available on the pro version.

So in this case, because you can get a Gmail account for free, let’s just walk through that. So go ahead and click Gmail, Save and Continue. And it’s warning us that it does work for Gmail works great for low numbers of emails. So what this is basically referring to is that if you’re trying to send a ton of email from your website, some of the different email servers may have limitations. But again, if you’re just talking your typical website, where you maybe get a couple submissions from your contact form, Gmail is a great option. So in this case, now we have to actually configure the email to send from Gmail. And, basically, to type in this information.

WP Mail SMTP and Gmail

To get it, you’d actually go ahead and click this link here to read about how to use the Gmail email sender. And so WP SMTP, goes through the different steps here. So it shows us how to configure the plugin, which we’ve already done, then it gets into the information, how to basically create a web app for your Google account. And so basically, this walks you through it there is I would make a lot of technical steps here on how to set this up. But again, just follow through on their things to create something called an API. And given different information there. Finally, you’ll get your credentials. And you set that up, I think, gonna walk you through the different steps, how to set up the app, the app domain, contact information, add some users, app registration, credential credentials.

And again, there’s a lot of steps here, but you just kind of walk through, you only have to set this up at the beginning. And then ultimately, you get your authorization and your different credentials. from Gmail, and then that information, the client ID and the client secret can be put back into w, p mail smtp. And the different information, you can actually send a test message. So I’m going to stop at this point, because to set that up, requires a little more time. And again, the documentation is right there, you can just walk through all of that to get that set up. So we’re gonna go ahead and just exit out of the setup wizard. And we’re back into the General tab there.

WP Mail SMTP and other mailers

One thing I did want to show you is if you do run into wanting to use a different one, like let’s just say for example, you’re using, well, actually it’s do the other SMTP here, and you can look at checking out their SMTP documentation. And it goes through basically how to set all that information up. So each one of the different mailer options you can pick on Do they have great documentation, how to set those up. Okay, we’ll go ahead and set that back to default for the test or to finish it up. So the last thing I just wanted to show you was some information about the pro version of this tool. So in addition, well the main reason to use the pros if you have an email that you’re using you email server already for your business and you want to use that.

So for example, if you’re using outlook.com, you’d have to buy the pro one. If you’re using Microsoft’s office 365 for email, you’d have to use that one. And again, it’s just something you have to pay for. The Pro version again does open up some of those other features. So one that is kind of cool. Is the email logging so you can keep track of every email that was sent from your website, you get some notifications, which you may find useful. And the big key is just to get access to some of the different server, different email servers options that the default, I mean, the free version doesn’t have to choose to want to upgrade to the pro to get access. To get a license key, you can just click the link here in the settings that it takes you off there and you can perform the upgrade and then that’ll give you access to the different options.

So to summarize again, WP mail SMTP is a WordPress plugin that allows you to reconfigure WordPress website to send email through an email server that you control could be your company server, such as an office 365. One could be your free g gmail account, or it could be an email relay that you might set up that allows you to send more emails from different sources like that. Once all this is configured, you can actually come back into the email test and go ahead and confirm that’s all working. And then you should see that your email deliverability is improved because now you’re sending it from the email server that other email servers assume you would be sending email from not a website. Hope this helps.

Conclusion about sending email reliably from a WordPress website

So some conclusions again. There are many cases where we want our websites to send email. Out of the box default WordPress does not send these in a fashion that is usually interpreted correctly by other email servers in the sense of making it look like spam. So we need to do some things to improve that so we can improve our email deliverability. There are WordPress plugins that can help with this using the SMTP protocol. They do need to be configured to connect from your website then to the different email services you’re using. But the ultimate result is this does greatly improve the reliability of emails that originate from your WordPress website.

Need website hosting?

WP Engine is a great WordPress-managed website hosting company for the following reasons:

  • WP Engine take care of all the installation and upgrading of WordPress.
  • WP Engine automatically backup WordPress daily.
  • WP Engine provide security and performance optimization for your website.

This page may contain affiliate links. At no additional cost to you, we may receive commissions for purchases.  Please see our disclaimer.  Thank you for your support.