Are you having trouble such as your WordPress not sending email? Then using a free SMTP server might solve your issue. By default WordPress uses the PHP mail function for sending emails. But in many cases it lacks proper configuration and doesn’t work the right way. For this reason, it’s essential to use a secure channel for your emails. In this case, the SMTP method can offer improved deliverability, security, and reliability.
In this post, we’re going to learn how to fix the WordPress not sending email issue. We are going to use SMTP to solve this problem. SMTP stands for Simple Mail Transfer Protocol, this allows you to send emails through a dedicated server, which is more secure and reliable. There are several free SMTP options for your WordPress site, we will take a look at two of the popular ones.
We will learn how you can set up the SMTP server and connect it with your WordPress site. Then we will test out if you can successfully send emails using it. Let’s get started.
Why is my WordPress site not sending emails?
When you’re working with your WordPress website, you might find an issue that your WordPress site is not sending emails. Again, on your WordPress site, it might tell you that the emails are being sent, but you’re not receiving it. This is a common problem seen in both a live or a localhost WordPress site.
WordPress uses a function called wp_mail to send emails using PHP. This function uses the site’s web server to route and deliver emails. But if you’re not receiving emails, then it might be one of the following reasons:
- Emails go to the spam folder: Most of the email providers have the ability to detect malicious or spam emails. Unfortunately, the WordPress emails are flagged as spam as most of those are automated. This is why emails from your WordPress probably goes to your spam folder.
- The server is not configured: Many web hosts don’t have their servers set up correctly to send PHP emails. This leads to problems on WordPress sites that use the built-in PHP mail function.
- Poor sender reputation: The deliverability of your WordPress emails may be impacted by other senders sharing the same server if you are on a shared IP address. Their high bounce rate and volume of complaints will negatively impact your reputation as well.
- Contact form plugin not configured: If you use a plugin for a contact form make sure the email details are correct. It also has to have its mail server set up correctly.
- Host related issues: Different web servers place restrictions on how many emails can be sent. You won’t be allowed to send any more if you try to send more than that.
In case you’re using a localhost WordPress site, you can check out our post on how to send emails from localhost WordPress.
How to solve WordPress not sending email issue
The most popular way to fix this issue is using an SMTP service for sending emails from WordPress. In order to connect an SMTP server with a WordPress website, you need a plugin. There are many SMTP providers to choose from. For our tutorial, we’re going to use two renowned SMTP solutions, Gmail SMTP server and Brevo. If you have your personal favorite, you can use that as well. The process is almost similar.
If you want to follow this tutorial, you can use either of the SMTP solutions mentioned in this article. Just follow the steps and you can send emails from your WordPress site.
Method 1: Sending emails using Gmail SMTP server
Gmail from Google is one of the most popular email services today. You might already be using Gmail for exchanging emails. However, Google also lets you use Gmail as an SMTP server for sending emails. With the free option, you can send up to 500 emails in a day (24 hours period). But if you want to send even more emails, you have to upgrade to a paid plan.
Since we are looking for a free SMTP server solution, a free Gmail account will suffice. We can use Gmail’s SMTP sever on several different applications like Microsoft Outlook, and also on WordPress. To enable WordPress to send emails using the Gmail SMTP server we need the following:
- Create a Google app from the Google Developer Console
- Configure our WordPress to send email using the Google app that we created
So if you’re facing the issue of WordPress not sending emails, you can follow this method to solve this problem.
Step 1: Install an SMTP plugin
First we need to install an SMTP plugin in our WordPress site. The Post SMTP plugin can be installed by going to Plugins > Add New Plugin. Once you install an active Post SMTP you might be asked to subscribe to the newsletter. You may choose to skip this.
![installing post smtp plugin](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/installing-post-smtp.png?resize=727%2C590&ssl=1)
Step 2: Configure the SMTP plugin
Post SMTP has a setup wizard which you can use to configure the plugin quickly. The setup wizard has 4 steps. In the first step, you’ll be asked to choose a mailer. Select Gmail API and click on the “Continue” button.
![choosing gmail api](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/choosing-smtp-mailer-in-post-smtp-setup-wizard.jpg?resize=800%2C679&ssl=1)
In the next page you can choose “From Email” and “From Name”. After you set those, look below and you’ll find two fields “Client ID” and “Client Secret”. To fill up these two fields, we need to create a Google app. The other two fields are “Authorized JavaScript Origin” and “Authorized redirect URI”.
![gmail api client id and secrect id fields in post smtp](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/configuring-mailer-settings-in-post-smtp.png?resize=569%2C802&ssl=1)
In the next step, we’re going to create a Google app through our Google Developer Console. After the app is ready, we will get our Client ID and Secret.
Step 3: Create Google app and get Client ID and Secret
To create a Google app, we need to visit our Google Developer Console page. If this is your first time visiting the Google Developer Console, you’ll be prompted by Google to create a new app. You can click the appeared button to create your first app. If this isn’t your first time visiting Google Developer Console, you’ll see your dashboard.
You can create your Google app by clicking the drop-down located just to the right side of the Google Cloud logo. Click “New Project” and name your project. After it’s created and selected, click “Enable APIs and Services”. This will bring the API library.
![new project in google developer console](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/creating-new-google-app-and-enabling-api-and-services.png?resize=784%2C444&ssl=1)
Select Gmail API from the Google Workspace section, or you can search for “Gmail API” on the search bar.
![gmail api in library](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/gmail-api-selection.png?resize=1024%2C413&ssl=1)
This will bring you to the Product detail page. From here, click on the “Enable” button.
![enabling gmail api](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/enabling-gmail-api.png?resize=612%2C430&ssl=1)
After enabling Gmail API it will bring you to the API/Service details page. From here, click the “Create Credentials” button.
![create credentials button in gmail api](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/create-credentails-of-gmail-api.png?resize=800%2C292&ssl=1)
In the next few steps, we will be setting up the app credentials. In the first step, we can select the credential type. Select what API you’re using, and then select which type of data you’ll be accessing. For API selection, select Gmail API and for what sort of data we will be accessing, selecting User data is the best path for us.
![gmail api credential type](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/setting-credential-type.png?resize=978%2C739&ssl=1)
Then click the “Next” button. Now we have to set up an OAuth Consent Screen. Here you have to provide an app name, user support email address, and developer contact information email address. You can also upload an app logo but this is optional.
![gmail api oauth consent](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/setting-up-OAuth-consent.png?resize=825%2C909&ssl=1)
When you’re done, click “Next” to proceed to the next step. There you can choose Scopes, but since this is optional, we’re going to skip it.
The next step is OAuth ClientID. First click the Application type dropdown and select Web Application. This will produce some more fields and options. Give a name to your OAuth client. Then you’ll find two sections, Authorized JavaScript origins and Authorized redirect URIs.
![authorized javascript origins and redirect uri](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/pasting-authorized-javascript-orgin-and-redirect-uris.png?resize=800%2C904&ssl=1)
If you don’t see the URI field, you can click the “+ADD URI” button to generate it. To find the URIs, go back to your WordPress dashboard, and if you haven’t logged out of your WordPress site or closed the browser tab, you should still be in the Post SMTP setup wizard screen. If you’re not in the setup wizard screen, then you can find these options in WordPress Dashboard > Post SMTP > Settings.
![authorized javascript origins and authorized redirect uri of a wp site](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/copying-authorized-javascript-origin-and-redirect-uris.png?resize=570%2C802&ssl=1)
Copy the Authorized JavaScript origins and Authorized redirect URIs and paste it on your Gmail SMTP app OAuth configuration section. Finally when you’re done, click on the “Create” button.
Now that the app has been configured, you can find the Client ID and secret. If you can’t find both, click on the credential page link.
![gmail app credentials page link](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/credentials-page-link.png?resize=574%2C445&ssl=1)
Then it will bring you the app credentials page. Now for your app, click on the “Download OAuth Client” icon under Actions. Now copy the Client ID and secret.
![gmail app client id and client secret](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/copying-client-id-and-secret.png?resize=799%2C258&ssl=1)
Paste those on your Post SMTP setup wizard section.
![pasting client id and client secret in post smtp](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/pasting-client-id-and-secret.png?resize=553%2C371&ssl=1)
Important: Also, before you click Connect, there’s one more thing you need to do. You need to publish your app. Otherwise you might receive an error during connecting. To solve this error, we published our app. To do this, go to the OAuth Consent Screen from your Google Developer Console. Click on the “Publish App” button.
![publishing or verifying gmail or google app](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/publishing-or-verifying-google-app.png?resize=800%2C404&ssl=1)
You can submit your app for verification but it might require some time before the app is verified. It is also possible to continue without verification, which we did because we didn’t want to wait for the app to be verified. But when you’re connecting your Google app, make sure to verify it before continuing.
Step 4: Connect to Gmail API and send test mail
Finally click on the “Connect to Gmail API” button to complete the connection process. Next you’ll be asked to choose an account, simply select the account you used to create the Google app. The app should connect automatically with your WordPress site. Once it’s connected, you should see a success message on your Post SMTP setup wizard
“The OAuth 2.0 authorization was successful. Ready to send e-mail.”
Now you’re ready and your WordPress can now send emails. But we will continue with the setup wizard, so click on the “Save and Continue” button. Now to actually see if Post SMTP is working or not, we should send a test mail from our WordPress site. In this step of the setup wizard, we can send a test mail. Just add the email address where you want the test mail to be sent to and click the “Send Test Mail” button.
![sending post smtp test email](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/sending-test-mail-with-Post-SMTP.png?resize=800%2C666&ssl=1)
Once the email is sent successfully, you’ll see a message. Then check the inbox of the recipient email, and you should find the test mail.
![test email of post smtp](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/postman-smtp-test-mail.png?resize=799%2C351&ssl=1)
So that is how you can fix your WordPress not sending email issues. Now your WordPress website should be able to send emails. However, do keep in mind the number of emails your site can send per day is limited. As far as we know, right now the free plan of Gmail SMTP can send 500 emails per day. If you require more emails, then consider getting a paid plan of Google Workspace.
To complete the setup wizard, finally click on the “Finish” button. You can use Post SMTP to send emails from your WordPress site. The plugin also keeps a log of all the emails that are sent in the Post SMTP > Email Log section.
Method 2: Sending emails using Brevo
Brevo, which was formerly known as Sendinblue is another service that can help your WordPress send emails. Using Brevo you can send marketing emails as well as transactional emails. Brevo is also a good MailChimp alternative.
It’s easy to use Brevo with WordPress because it has a plugin that you can install on your WordPress site. So follow the steps below to fix your WordPress not sending email issue:
Step 1: Create a free Brevo account and generate an API key
To get started, first you have to create a free Brevo account. After you verify your account, you will be asked to pick a plan. You can choose any paid plan if you like the benefits. But we’re going to continue with the free plan.
After getting the desired plan, you’ll be redirected to your Brevo dashboard. From here click on you profile dropdown on the top right corner of the screen and select “SMTP & API” option.
![brevo smtp and api option](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/brevo-smtp-and-api-option.png?resize=800%2C374&ssl=1)
Now click “API Keys” then hit the “Generate a new API key” button located on the top right corner of the dashboard. Then a new section should pop up. Here you can give a name to your API key. After you name it, click the “Generate” button.
![generating api key in brevo](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/generating-brevo-api-key.png?resize=799%2C315&ssl=1)
After it is generated, you’ll be given the key, so copy it because we’re going to need it in a few minutes.
Step 2: Install and activate Brevo plugin
Now we need to install the Brevo plugin. Go to your WordPress dashboard and navigate to Plugins > Add new plugin, then search for Brevo. The plugin looks something like this:
![installing brevo plugin](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/brevo-plugin.png?resize=547%2C524&ssl=1)
Make sure it says “By Brevo”. Click “Install Now” and click on “Activate” after it’s installed. Then the Brevo menu options should be added to your WordPress dashboard. If you don’t see it, simply refresh your page.
Step 3: Connecting the WordPress site with Brevo account
Now navigate to Brevo > Home from your WordPress dashboard and simply paste the API key that you generated earlier and click the “Login” button.
![connecting wp site with brevo account through api key](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/pasting-api-key-in-brevo.png?resize=798%2C247&ssl=1)
This will connect your WordPress site with your Brevo account. After you put in your API key and login, two new sections will be generated. Here you can choose if you want to send Transactional emails and marketing automation through Brevo. Select “Yes” for the option you prefer.
![brevo settings](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/sending-test-mail-through-brevo.png?resize=799%2C235&ssl=1)
Step 4: Sending test mail
To send a test mail, add an email address in the field that says “Enter email to send a test”. This is the email address where your test mail will be sent to. Then click on the “Send email” button.
![wordpress not sending email fix](https://i0.wp.com/wpgiz.com/wp-content/uploads/2024/06/brevo-test-mail.png?resize=800%2C375&ssl=1)
Now you can check the inbox and you should find the Brevo test mail. So that is how you can solve your WordPress not sending email issues using Brevo.
Brevo is a great SMTP option for your WordPress site. The free version allows you to send 300 emails per day, which is really great and works for many small organizations. But if you have a large organization, and you need more email limits, then consider upgrading to any paid Brevo plans.
👉 Video: WordPress Not Sending Email Problem Solution
Conclusion
Emails are a very important aspect of a website today. Again, if you’re managing a WordPress website, this is even more important. There are various reasons why a WordPress site needs to send emails. Whether it is to change password, order confirmation, or even general notifications, WordPress needs to send emails (aka transactional emails) from time to time. Also, if you’ve added any contact form on your site, users might not be able to contact you with that if your WordPress site isn’t configured properly to send mails.
So when you’re creating a WordPress site, always ensure that it can send emails. In this tutorial we’ve looked at two very popular SMTP options. You can use either to send emails from your WordPress website and also look at the logs of how many emails were sent.
Disclaimer: This post may contain affiliate links and we may receive a small commission if you purchase something by following them. However, we recommend services/products that we believe good to serve your purpose.