If you are building a new WordPress website, an issue you may run into is your website not being able to send emails. Whether this is password reset emails or WordPress notification emails such as plugin update notifications, or contact form messages, you may find that emails are not being sent.
This is a question that I see pop up online all the time, and in my experience as a WordPress Support Specialist, one of the most common issues people would reach out about.
The solution isn’t super hard, but it may not always be immediately obvious. Whether you are building your website yourself, or had it built by a freelancer and handed off, this may be something that was not addressed and could be losing you important leads or business.
Why am I not getting my contact form submissions?
WordPress uses the wp_mail function to send emails, which is based on the PHPMailer library. If you have your own server set up and configured properly to send emails, and the reputation of the server’s IP address is not blacklisted, you can potentially send email through your server. Unfortunately, this is not likely to be the case on most shared hosting. Chances are that on most shared hosting accounts, your IP address could be blacklisted from email servers. There is also a good chance that the hosting doesn’t have things configured properly to facilitate email delivery. Even if they do, sending emails this way is going to make it harder to track delivery, or know if there is a problem.
So… how do I make my website send emails?
The easiest and most reliable way to send emails through your website requires two things. An email sending API and an SMTP Plugin. The SMTP Plugin will make your website utilize this third-party email sending API to deliver your emails, instead of relying on the built in WordPress methods and whatever your web host has set up to deliver emails, which often times, will fail.
1. An email API
There are several of these to choose from. Many of them have a generous free tier, which should be enough for your average small to medium business. MailGun’s free plan can send up to 100 emails per day without requiring any credit card information. Same with SendGrid’s free plan. Note: This content is not sponsored by either of these companies. I have personally built and configured websites using both services and had a good experience, but there are many others to choose from as well. I would encourage you to explore your options and choose whichever service fits your needs.
You will need to create an account, then authenticate your domain with some host records, and possibly create a sending address, you will also need to create an API key. This is how your website will connect with the service.
2. An SMTP Plugin
The next step is to install an SMTP Plugin on your website. This is how your website will connect with your email API and use it to send its emails. A common point of confusion I see online when folks are trying to figure this out, is that they think the email sending service needs to match up with where the email is being delivered. For example, it would need to be set up with Outlook 365 to be able to land in your Outlook inbox, or it would need to be set up with Gmail SMTP to land in a Gmail inbox. This is not how it works — if you find that your email is able to deliver to some types of email inboxes and not others, it is more likely that the email providers have different levels of spam filtering set up.
Fluent SMTP or Post SMTP are both solid options for SMTP plugins. Both have important features such as email logging even in the free version. Install your plugin of choice, and configure it with your provider of choice.
A couple more notes
After configuring the plugin with your email provider, make sure you have set a “from email” address in the plugin, and make sure to enable the setting that does not allow plugins or themes to override this address. In some cases, plugins will attempt to use the admin email address to send emails from, and if that doesn’t match your authorized sending address or your domain, it probably won’t be able to send emails. The easiest solution is just to make your from address something like no-reply@yourdomain.com
Also, be sure to send out a couple test emails, and even fill out a couple of test form submissions after setting this up. If it is set up correctly, you should see emails land in your inbox, not in your spam. Try sending to a couple different types of email addresses to make sure it is consistent.