How to Send a Test Email From WordPress
February 26. 2022
If you’ve got that eerie feeling that your WordPress site might not be sending emails as it should, know that you’re not alone. Every site owner asks this question sooner or later, and by the end of this article, you’ll know how to answer it. You’ll learn how to send a test email from WordPress and eliminate the uncertainty once and for all.
There are plenty of reasons you would want your WP site to send emails on its own. Maybe someone wants to change their password, or maybe it should mail purchase receipts to your customers. Either way, it isn’t good if this feature doesn’t work, so today, we’ll dive into fixing it.
Now, some of you will like to use a plugin, and some won’t, so we’ll make sure to cover both ways to do it. We’ll also talk about some tools you can use to manage your emails and bypass WordPress altogether. Read the article throughout, and you won’t deal with spam emails on your WP site ever again.
How to Send a Test Mail From WordPress
Request a Password Reset Email
The easiest way to check if your WordPress site sends emails is to request a password reset. To do it, you’ll need to log out of your account and go to your login page. If you’re not sure how to find it, you can access it directly via the link: yourwebsitename.com/wp-admin.
Under the form, you’ll see a clickable text saying ”Lost your password?”. Click it, and it’ll take you to the next page, where you can enter your other email address and click ”Get New Password”. If everything works properly, WordPress will send an email to the address you typed in.
Check your inbox, but don’t rush into making any decisions too soon. Sometimes, email takes more than 10 minutes to get there, so arm yourself with patience. That said, if you get nothing after 15 minutes of waiting, it’s safe to assume that the mail won’t get delivered at all. Check your spam folder just in case, and if there’s nothing there, you can move on to the next step.
Use a Free Plugin to Send an Email
WordPress is big on plugins, and many people working on the platform love to use them. If you’re one of them, you’ll love the Check Email plugin for its simplicity. It’s free, easy to use, and will do what it says on the tin — send a test email from WordPress.
To check if your mail is working properly, you’ll want to install the plugin as any other, and then go to your wp-admin – Tools – Check Email.
It may seem that the plugin is looking a bit daunting, as it tells you about the SendMail path and SMTP servers right away, but you don’t have to worry about it. Just enter your second email in the form further down, and you’re all set. Click that ”Send test email” button, and wait for your message to arrive.
However, one thing to keep in mind here is that Check Email checks if your site can send emails, but not if they’re deliverable. If you want to make sure you aren’t missing anything, send your test email to mail-tester.com. It won’t block your emails even if they’re spammy, so you’ll know for sure where the problem is.
Use a PHP Script to Check
Our WP Full Care experts warned us that this is for more advanced users, but we thought that some beginners might find it interesting.
If you want to check your emails with a PHP script, there are two ways you can do it.
The first is to log into your server using SSH and use the command line to run the script. The second way is by creating a new .php file in your root directory.
Now, if you don’t have a dedicated server, the chances are that your host won’t provide access to the command line, so we’ll go for the latter version. Create your test.php file and add the following text to it:
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;
echo “Test email sent successfully”;
All that is left is to save the code and run the script. You do that by visiting the file in your browser. So type in ”yourwebsitename.com/testing.php”, and that’s it. If there are any errors, you’ll see them at the top of the page.
What to Do If None of the Emails Arrive?
If you try all three ways and none of them gets you the message to your inbox, it means something isn’t as it should be. So, of course, the first step should be finding out what went wrong. But if you aren’t a developer, you’ll need some help to get to the bottom of it. The best thing you can do here is to contact your host.
Sit down and write an email for them. Make sure you’re polite and explain to them what’s going on. In essence, you want to tell who you are, that you have a WordPress website, and that it won’t send any emails, including password reset ones. Ask them to check the PHP Mail configuration for your website, and they should quickly take care of it.
Install an SMTP Plugin to Take It a Step Further
Out of the box, WordPress uses PHP mail to send emails, and it’ll send them through your host’s server. If you don’t feel they’re reliable enough, you can bypass them by installing an SMTP plugin. We already talked about these in our article on setting up WordPress email tracking, so we won’t deal much with them today.
Still, we’ll tell you what these plugins do. And they allow you to route all your emails from your WP site to a dedicated sending method. Most businesses go for SendGrid or Amazon SES, but you can also use Gmail if you feel like it.
And now that you read it all, learning how to send a test email from WordPress isn’t as daunting as it seemed at first glance, is it? If your troubles with emails delivery stay no matter what you do, feel free to contact us, and we’ll see what we can do to help.