A very common issue we see among website owners is WordPress not sending emails correctly or at all. Most managed WordPress hosting providers, including Kinsta, don’t provide email hosting. However, that doesn’t mean you can’t send emails. Typically when you are trying to fix the WordPress not sending emails issue it is not a problem on the server, but rather email is setup incorrectly on the WordPress installation or there is an incompatibility. Follow the steps below to get email up and running on your WordPress site. This should be applicable for almost any WordPress hosting provider, as well as WooCommerce not sending emails.
Fix WordPress Not Sending Emails
Typical scenarios of WordPress not sending emails might include a submission to a contact form that you never receive, or a 3rd party plugin notification. This could also apply to WooCommerce not sending emails from recent sales or customer inquiries. Typically these issues are caused by incorrect settings in plugins or an incompatibility with HHVM, PHP 7, etc. Below are some quick solutions to get you up and running fast.
Test Email On Your Server
The first thing you can do is run a test on your WordPress site with the free Check Email plugin. This is a very basic plugin designed to simply test if your WordPress installation and or server can send emails. As of writing this, the plugin has over 30,000 active installs with a 4.9 out of 5-star rating. Once installed, simply click into “Check Email” under the tools menu in your WordPress dashboard. Enter in an email address to send a test to, and click on “Send test email.”
Test email on your WordPress site
You will then see a confirmation.
Test email confirmation
Check your email client to see if you received the test email. The subject line will appear as “Test email from https://yourdomain.com.” Also, make sure to check your spam or junk mail folder. If you received an email that means that WordPress can send emails just fine on your web server. This means it is most likely a misconfiguration with your contact form plugin or an incompatibility. You can always reach out to the plugin developer for help. Let them know that you ran the above test and that email is working on your WordPress installation itself.
If you are a Kinsta customer and using HHVM, you can temporarily switch over to PHP 7 to test if there is a compatibility issue. You can easily switch to PHP 7 within your My Kinsta dashboard. After testing, you can switch back to HHVM.
For both Kinsta users and those with other hosts, if you have connection issues you might also have to try an alternative port. Your host might be blocking the port. Kinsta uses Google Cloud Platform which by default blocks outbound connections on ports 25, 465, and 587. According to Google, “These outbound SMTP ports are blocked because of the large amount of abuse these ports are susceptible to.” In this case, try an alternative port such as 2525.
How to Setup SMTP in WordPress
If the above recommendations didn’t work for you then the best solution is to setup WordPress with a 3rd-party SMTP provider. Here are three you can choose from and instructions on how to configure them:
Here are a few additional SMTP/transactional email services you might also want to consider:
1. Configure Gmail SMTP in WordPress
You can utilize Gmail SMTP to send out emails in WordPress. A benefit to doing it this way is you can sometimes improve the deliverability of your emails and prevent more from hitting the spam or junk mail folder. However, it is important to note that in the free version they only allow you to send up to 100 emails every rolling 24-hour period. Or you could also look at it as 3,000 emails per month for free. However, you can increase these limits by paying for G Suite. If you want a completely free SMTP provider with a large monthly limit we recommend checking out Mailgun. Follow the steps below to configure Gmail SMTP in WordPress.
The first thing to do is install the free plugin called Gmail SMTP. As of writing this, the plugin has over 20,000 active installs with a 4 out of 5-star rating. It also works great with WooCommerce and Easy Digital Downloads.
Gmail SMTP WordPress plugin
Gmail SMTP plugin is not like most SMTP plugins. It uses the OAuth 2.0 protocol to authorize access to the Gmail API – which means a more secure login system and users won’t have to enter any username or password.
You will then need to open up a new tab and create a new project with Google. Go to console.developers.google.com and log in with the Gmail you will be using to send emails. You will then need to create a new project.
Google Developer Console – Create new project
Give your project a name (you can choose anything) and click on “Create.”
Name Google Project
In the dashboard of the new project click on “Enable APIS and Services.”
Google Project enable APIs
Then click on “Gmail API” under G Suite APIs.
Then click on “Enable.”
Enable Gmail API
Then click on “Credentials” on the left-hand side. And then under Create credentials choose “OAuth client ID.”
OAuth client ID
On the next screen, you will need to click on “Configure consent screen.”
Configure consent screen
Client ID Application Type
Confused on where to find your Authorized redirect URI? It is located at the top in the Gmail SMTP plugin settings in your WordPress dashboard.
Authorized redirect URI
On the next screen, you will get your client ID and client secret.
OAuth client id and secret
Copy and paste these into the Client ID and Client Secret fields in the Gmail SMTP plugin. You should then fill out the rest of the settings.
- OAuth Email Address: The email address that you will use for SMTP authentication. This should be the same email used in the Google Developers Console.
- From Email Address: The email address which will be used as the From Address when sending an email.
- From Name: The name which will be used as the From Name when sending an email.
- Type of Encryption: The encryption which will be used when sending an email (either TLS/SSL). By default, it should be set to TLS.
- SMTP Port: The port which will be used when sending an email. If you choose TLS it should be set to 587. For SSL use port 465 instead. If you have issues with these it might very well be because your host is blocking them, in which case you could try using port 443 on SSL.
Gmail SMTP additional settings
Then click on “Save Changes.”
Then back in the Google Developer Console, it is recommended that you add your domain so it is verified. Note: You should also have this setup in Google Search Console.
Verify domain in Google Developer Console
You will then need to “Grant permission with Google” in the plugin settings.
Gmail SMTP grant permission
Since you verified your domain you shouldn’t see this, but you might get the following error message as Google has recently enhanced their risk assessment for new web applications that request user data. Based on this risk assessment, some web applications will require a manual review before users can approve data permissions. Until the review is complete, unverified apps will display an “invalid_scope” or some other random error messages when you go to the permissions consent page.
This app isn’t verified
You can click on “Advanced” and proceed anyway but should fill out this developer application to get approved long-term. You should then see an “Access Granted Successfully” message and the SMTP status will show connected.
Gmail SMTP access granted
Sending a Test Email
You can then send a test email to verify everything is working correctly.
Gmail SMTP test email
You can also check out more troubleshooting tips for the Gmail SMTP plugin.
2. Configure MailGun SMTP in WordPress
Mailgun is a transactional email API service designed primarily for developers. However, even non-developers can easily implement their service. We’ll show you below just how easy it is! One of the huge benefits of Mailgun is that they allow you to send up to 10,000 emails for free per month. The next 500,000 are billed at $0.00050 based on usage, which is cheap. For a lot of small businesses or WordPress developers, 10,000 emails might be more than you need.
Mailgun WordPress plugin
Check out our in-depth tutorial on how to configure Mailgun in WordPress.
3. Configure SendGrid SMTP in WordPress
Another great alternative is SendGrid. They have a free trial, which allows up to 40,000 emails in the first 30 days. You can download their free WordPress plugin from the WordPress repository. As of writing this, the plugin has over 60,000 active installs with a 4.5 out of 5-star rating. The plugin replaces WordPress’s default wp_mail() function by using either an SMTP or API integration.
Sendgrid WordPress plugin
SendGrid has a long history of providing great email deliverability and secure mail for big brands such as Airbnb, Spotify, and Uber. We even use SendGrid ourselves here at Kinsta for all transactional emails. Once you install the plugin, simply click into it under your WordPress dashboard settings and configure it with your API key. See SendGrid’s API documentation.
SendGrid WordPress plugin settings