Do you have that eerie feeling your WordPress install isn’t sending emails, like new comment notifications, for example?
All WordPress site owners have wondered at one point or another if there’s an issue with their site’s emails.
In this guide, I’ll teach you how to quickly check if your WordPress website is sending emails with and without a plugin, and a more technical way as well with PHP.
How to check if WordPress sends emails
Step 1: Check by requesting a password reset email
The easiest method to check if WordPress sends email is to request a password reset. To do this, make sure you log out of your account on your site and go to your login page, e.g. example.com/wp-login.php
On that page click the “Lost your password?” text:
On the next page, enter the email address of your user account and click “Get New Password.”
Now, go and check your inbox to see if you received the email. Be patient! It can take up to 10 minutes and sometimes longer for the email to be delivered. Also, check your spam folder just in case.
If you haven’t received a password reset email after 15 minutes in either your inbox or your spam folder, it most likely won’t be delivered at all.
Step 2: Use a free plugin to send an email
You can use the Check Email plugin to test if your WordPress sends email. It’s a free plugin (one of many we recommend) and it’s super fast to use.
Simply install the plugin and then go to your wp-admin > Tools > Check Email.
It may look daunting at first talking about SendMail path and SMTP servers, but all you need to do is enter in an email you have access to in the “Send a test email” settings and then click on “Send test email”.
If everything went well, you’ll see a success message like this:
It’s important to note the Check Email plugin checks if your WordPress install can send email. It does not check the deliverability of your emails.
I highly recommend sending your test email to a mail-tester.com email address. Why? Gmail, Yahoo, Hotmail, and other email service providers (ESPs) can block emails instead of filtering them into the spam folder, whereas mail-tester always receives emails without blocking them, ever.
Step 3: Check with a PHP script
This is for the more advanced user, although some beginners may find it useful.
There are two ways you can do this, either log into your server using SSH and run the script from the command line or you can create a new .php file in your root directory. We’ll do the latter, as most hosts won’t provide access to the command line unless you have a VPS or a dedicated server.
For example, you can create testing-php-mail.php and in the file add:
<?php ini_set( 'display_errors', 1); error_reporting( E_ALL ); $from = "firstname.lastname@example.org"; $to = "email@example.com"; $subject = "PHP Mail Test"; $message = "It works! You can send email using PHP Mail"; $headers = "From:" . $from; mail($to,$subject,$message, $headers); echo "Test email sent successfully"; ?>
Save your code. To run the script, visit the file in your browser, which would be example.com/testing-php-mail.php if your domain was example.com. If any errors are present they’ll show at the top of the page.
What to do if WordPress emails don’t send?
If for any reason your WordPress install isn’t sending any emails, the first thing to do is to try and diagnose why. We’ve already written an extensive post on diagnosing WordPress sending issues to help you with that.
Contacting your host
If you find that the PHP Mail module is installed, the next step is to contact your web host. You can use this sample message to email them:
“Hi there, I have a WordPress website that won’t send any emails at all, including password reset emails.
Can you please check the PHP Mail configuration for my website?
Going further with WordPress emails
Log your WordPress emails
If you’re unsure that your WordPress sends email, you can also use a plugin called WP Mail Logging, which logs all emails your WordPress site tries to send.
Using WP Mail Logging to log WordPress emails
Install the WP Mail logging plugin and then when your site next attempts to send an email it’ll be logged. To check your email log, go to wp-admin > WP Mail Log.
In the list, you’ll see every email that your WordPress install has tried to send. It’s important to note though that like the Check Email plugin, the WP Mail Logging plugin only logs successes and errors that your emails could be sent/generated. It doesn’t check or diagnose deliverability issues.
For more information about email logging, check out our post ‘A simple guide to WordPress email logging’.
Installing an SMTP plugin
Out of the box, WordPress sends all emails via PHP mail, which is sent via your host’s servers.
If you feel that your host is not reliable and you don’t want to send email with them, you will want to use an SMTP plugin, which we recently wrote about on the MailPoet blog.
Using such a plugin allows you to route all your emails from your WordPress install away from your host’s server and instead use a dedicated sending method such as SendGrid or Amazon SES, which should solve any deliverability issues you may be experiencing.
Checking if your WordPress sends email isn’t as daunting as it first looks!
If you need to press further about why your emails aren’t being delivered, we suggest checking out our guide to find out what what might be stopping your WordPress emails.
Want to learn more about email in WordPress? Read more in our Ultimate Guide: Create and Send Newsletters with the Best Email Plugin for WordPress.