Do you want to enable WordPress email logs?
Email logs can help you to save, track, and resend emails sent from WordPress.
In this guide, we’ll show you how to enable email logs in a couple of clicks.
How Do I View Email Logs in WordPress?
You can view your email logs and sent emails with the WP Mail SMTP plugin.
It lets you easily log WordPress emails and view the status in a log file or dashboard widget.
It’s more advanced than other email logging plugins because it can track the status all the way to the recipient’s mailbox. And it can also show you opens and clicks.
That means you can see a true picture of your email deliverability, right on your WordPress dashboard.
WP Mail SMTP also adds a detailed email log page to your WordPress admin area. From the email log page, you can:
- View headers: WP Mail SMTP saves all of the technical information associated with the email.
- Filter and search: Use the powerful filters to find and track your most important emails.
- Print email logs: Every email log can be printed or saved as a PDF.
- Log email contents: Save the message as well as the email headers (optional).
- Track email opens and clicks: See open and click data for every email you send from WordPress
- Resend failed emails: Resend in bulk or individually, or forward to a different address.
- Store attachments: Save the attachment file along with the log.
- Export sent emails in CSV, XLSX, or EML format
- View multisite email logs on separate pages easily.
If there are any errors, WP Mail SMTP keeps track of those as well.
How to Log Emails in WordPress
We’re going to show you the best way to log your emails with a WordPress plugin. Click the link below to jump to the section you want to try first:
- Enable WordPress email logs
- Log all email content
- Filter, search, & print WordPress email logs
- Log email opens and clicks
- Log attachments sent from WordPress
- Export WordPress email logs to CSV, XLSX, or EML
To get full WordPress email logging on your site, you’ll need the WP Mail SMTP Pro license or higher.
1. Enable WordPress Email Logs
We’re going to use the WP Mail SMTP plugin to log your WordPress emails. WP Mail SMTP used by 2+ million WordPress users to improve email deliverability and tracking.
To install WP Mail SMTP, download the zip file from your WP Mail SMTP account. You’ll find it in the Downloads tab.
Next, open up your WordPress dashboard. Head to the Plugins page and upload the zip file to install it.
If you’re not sure how to do this, check out how to install a plugin in WordPress.
As soon as you activate the plugin, the WP Mail SMTP Setup Wizard will open.
Choose Your Email Service Provider
Now we can set up your chosen SMTP provider using the Wizard.
Click the Let’s Get Started button to begin.
On the next screen, click the mailer you want to use from the list.
WP Mail SMTP supports a ton of popular email services, including many free options.
Logging the Email Delivery Status
Most email logging plugins will tell you if the email Sent or Failed.
But they can’t give you any information about what happened after that.
With WP Mail SMTP, you can unlock 2 additional status reports: Unconfirmed (Waiting) and Confirmed (Delivered).
Here’s what these statuses will tell you:
- Sent means that WordPress successfully generated and sent the email.
- Failed means that the email wasn’t sent. For example, you’ll see this if there’s a problem with your SMTP server or some other configuration issue.
- Unconfirmed means that the email was sent and WP Mail SMTP is waiting for the status.
- Confirmed means that the email was sent and delivered to the recipient’s mailbox.
Selected email providers support Unconfirmed and Confirmed. Here’s a chart to show each status and the mailers that support them:
|Email Service||Failed||Sent||Waiting/ Unconfirmed||Delivered/ Confirmed|
When you’ve chosen your mailer, jump to our documentation and continue the setup steps:
|Mailers available in all versions||Additional Mailers in Pro|
|Gmail / Google Workspace|
Come back to this guide when you’re ready.
Need a hand?
Our Elite license includes White Glove Setup.
In the final step, be sure to turn on Detailed Email Logs and Weekly Email Summary.
Detailed Email Logs will track your email headers and delivery status. Weekly Email Summary will send you a weekly email report.
For the best possible data, we recommend that you log the content of your sent emails as well.
2. Log All Email Content
As well as tracking the header and delivery status of each email sent from WordPress, you can save a copy of the entire content of the messages sent from your site.
This can be helpful when troubleshooting. For example, if you have an email customizer plugin for WooCommerce, you could save a copy of your order emails to make sure they’re formatted correctly.
Let’s turn on complete email logging on your WordPress site.
First, head to the Settings page in the plugin.
Now click the Email Log tab to open your WordPress email log settings.
Scroll down a little on this page and check the box next to Log Email Content.
This is an advanced option, so there are a couple of things to keep in mind:
- Logging the body of emails saves the content in your WordPress database. We recommend that you install a WordPress security plugin with 2-factor authentication so that your site is secure.
- Your database will grow. Over time, your WordPress database will get larger as you log the contents of all of the emails sent from your website.
To avoid any disk space issues, you can restrict the size of your email log. If you decrease the Log Retention Period, older email logs will be deleted automatically.
Now let’s take a closer look at the log file inside your WordPress dashboard.
3. Filter, Search, & Print WordPress Email Logs
Now you’ve set up WordPress email logs, every email sent using the
wp_mail() function will be logged. You don’t need to use a separate WordPress plugin for this, which is great because you can avoid any plugin conflicts that may affect your email deliverability.
If your email provider supports all of the statuses we talked about, it’s also reporting the status of every email: Sent, Failed, and (if supported) Delivered.
When we installed the plugin, the Setup Wizard generated a test email, so that’ll be in your log already. You can generate additional test emails in the Tools menu if you want to.
Now let’s take a look at the email logs. In your WordPress admin menu, open up WP Mail SMTP » Email Log.
Since your installation is new, you might not have many logs to look at yet. We’ll show how it’ll look when it’s been running for a while.
Let’s start by filtering the log by date. In this example, we want to find any emails that failed on 20th April.
WP Mail SMTP’s email log has a datepicker at the top so you can easily view the log files for a specific date or series of dates.
In the image below, we’ve used it to look for emails sent from our WordPress website between April 14th and April 21st.
Because we’re using Sendinblue, we can see a Delivered status with a green circle and checkmark for the first 3 emails, so we know those definitely reached the recipient’s mailbox.
One email is marked with a red dot, so we know that one Failed. If we hover over that line, we can see options to View Log or Delete.
Let’s click on View Log to see more details about the logged email.
From the individual log page, we can:
- Print the email log, or save it as a PDF
- Export this log as a CSV, EML, or Excel file.
Exporting as EML will export the full email content if you’ve got that option enabled. We’ll show you how that works in the next section of this article.
The email log also tells you which plugin generated the email.
You can click Resend to resend any email and customize the To address.
This can be helpful for resending new user activations and password reset emails.
At the bottom of the log, the Technical Details dropdown will show you the full headers for more detailed troubleshooting.
We can also see the exact error that the email provider returned:
In this case, the recipient was receiving too many emails and has hit their Gmail receiving limit. So we can be sure that it wasn’t a problem with our email provider or settings.
From the individual log file page, we can print this log file in Normal or Compact view. Compact view is helpful if you have a large log file and you want to save paper or reduce the size of the PDF.
Back on the main log screen, let’s look at the other ways to manage WordPress email logs.
The search bar lets you narrow down the list of email logs. You can use multiple search criteria to keep filtering the list until you find what you need.
For example, we already filtered by date. Next, we can search in the Subject and Headers to see if we have any other username and password emails that failed during the same week.
The new search is combined with the date search, and you can see both filters in the line above the log screen.
We can click the X icons to remove any part of the search if we want to broaden the results.
These filtering and searching tools make it easy to find any email and find out if it was sent, and – if your mailer supports it – if it was also delivered.
Let’s move on and see how to see if your emails are being opened.
4. Log Email Opens and Clicks
Now that you know for sure that your emails are being delivered, you’ll also want to check if the recipient is actually reading and interacting with the message.
In WP Mail SMTP Pro, you can log open and click data for every HTML email. WordPress email tracking is especially handy if you’re selling online courses or sending newsletters from WordPress.
First, head to the plugin’s Settings page.
And now click Email Log at the top to open your WordPress email log settings.
You’ll want to scroll down and enable these 2 settings:
- Open Email Tracking
- Click Link Tracking
Now you’ll be able to see open and click tracking data next to each individual email log.
And you can also see an overview from the main email log screen.
If you’re a Pro customer, you can get full open rates and click-through rates in your Email Report.
Keep in mind that open and click tracking relies on a tracking pixel. That means it works with most HTML emails sent from a live WordPress site, but might not work with SMTP on localhost until you publish your site on the internet.
Now we’ve looked at click and open tracking, let’s look at some more data we can log.
5. Log Attachments Sent From WordPress
WP Mail SMTP Pro allows you to save a copy of attachments sent out from your WordPress site.
For example, if you’re sending PDF invoices using a WooCommerce plugin, you can save each invoice for your own reference..
To do this, you’ll want to open up your WP Mail SMTP settings page again. Then click Email Log at the top to open the email log settings as we did before.
Now be sure to turn on all 3 of these options:
- Enable Log
- Log Email Content
- Save Attachments
Now each email sent from your site will be saved in WordPress along with any files originally attached.
You can download the file or resend the email to forward it.
If you want, you can also export the data, which we’ll look at next.
6. Export WordPress Email Logs to CSV, EML, or XLSX
The email log export tool in WP Mail SMTP lets you export email logs and customize the fields that are included in the file.
This is an awesome way to get your email logging data out of WordPress so you can analyze it in other tools and dashboards.
For example, you could track your email deliverability alongside your WooCommerce store activity, or create your own custom reports for agency clients.
To generate an Excel or CSV export file, head to WP Mail SMTP » Tools.
From the tabs across the top, click Export.
At the top, you can choose the file format and select the basic information to include.
Below that, you can pick more information and filter your search.
So in total, an XLSX or CSV WordPress email log export can include any combination of these fields:
|Common Information||Additional Information|
|Created date||Error details|
|Number of attachments||Log ID|
Additionally, you can also filter the export file by:
- Exact date or date range
- Email address
- Subject or header text
Keep in mind that exporting the Body or searching the Content will only work if you’re logging the contents of the emails sent from your site.
And that’s it! Now you know how to log your WordPress emails so you can track the status and generate your own deliverability reports.
Next, Send Email From a Gmail Alias in WordPress
Now you’ve got WP Mail SMTP, you can send different contact form notifications from as many Gmail aliases as you like. You can use the Force From Email setting to use 1 email for everything, or pick a default alias and use the others when you need to.
No matter which Gmail alias you use, WP Mail SMTP will automatically add the right authentication.
To learn more about this awesome feature, check out how to use a Gmail alias in WordPress.
Ready to log your emails? Get started today with the best WordPress SMTP plugin. WP Mail SMTP Elite includes full White Glove Setup and offers a 14-day money-back guarantee.