Log WordPress emails

How to Set Up WordPress Email Logs [The BEST Way]

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.

Log Your WordPress Emails Now

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 Pro dashboard widget

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:

  1. Enable WordPress email logs
  2. Log all email content 
  3. Filter, search, & print WordPress email logs
  4. Log email opens and clicks
  5. Log attachments sent from WordPress
  6. 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.

Download WP Mail SMTP to fix WPForms contact form not sending email

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.

Install WP Mail SMTP

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.

Start the WP Mail SMTP setup wizard to fix WPforms not sending email

On the next screen, click the mailer you want to use from the list.

Choose SMTP to fix WPForms contact form not sending email

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
SMTP.com
Sendinblue
Mailgun
Gmail
Outlook
Zoho Mail
SendGrid
Amazon SES
Other SMTP

So if you want the best possible email tracking, we recommend that you use WP Mail SMTP with Sendinblue, SMTP.com, or Mailgun.

When you’ve chosen your mailer, jump to our documentation and continue the setup steps:

Mailers available in all versions Additional Mailers in Pro
SMTP.com Microsoft Outlook
Sendinblue Amazon SES
Mailgun Zoho Mail
SendGrid
Gmail / Google Workspace
Other SMTP

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.

Enable WordPress email logs and weekly 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.

WP Mail SMTP settings menu

Now click the Email Log tab to open your WordPress email log settings.

Email log settings tab

Scroll down a little on this page and check the box next to Log Email Content.

Log email content in WordPress

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.

Log Retention period

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.

WordPress email log menu item in WP Mail SMTP

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.

Email log filtered by date in WordPress

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.

View or delete individual email log

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.

Formidable Forms contact form email log

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.

Resend WordPress emails in WP Mail SMTP

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:

Email log error

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.

Print email log in WordPress

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.

Search subject and headers in WordPress email log

The new search is combined with the date search, and you can see both filters in the line above the log screen.

Search filters in email log

We can click the X icons to remove any part of the search if we want to broaden the results.

Remove date filter from email log search

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.

WP Mail SMTP settings menu

And now click Email Log at the top to open your WordPress email log settings.

Email log settings tab

You’ll want to scroll down and enable these 2 settings:

  • Open Email Tracking
  • Click Link Tracking

Open and click tracking in WordPress

Now you’ll be able to see open and click tracking data next to each individual email log.

Open and click details in WordPress email log

And you can also see an overview from the main email log screen.

Opens and clicks in WordPress email log

If you’re a Pro customer, you can get full open rates and click-through rates in your Email Report.

Email Report grouped by subject line

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

Email log attachments settings

Now each email sent from your site will be saved in WordPress along with any files originally attached.

Open WooCommerce invoice attachment

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.

WP Mail SMTP Tools menu

From the tabs across the top, click Export.

Export email log

At the top, you can choose the file format and select the basic information to include.

WP Mail SMTP export - common information

Below that, you can pick more information and filter your search.

WP Mail SMTP export information - additional filters

So in total, an XLSX or CSV WordPress email log export can include any combination of these fields:

Common Information Additional Information
To address Status
From address CC
From name BCC
Subject Headers
Body Mailer
Created date Error details
Number of attachments Log ID
Attachments Opened
Clicked

Additionally, you can also filter the export file by:

  • Exact date or date range
  • Email address
  • Subject or header text
  • Content

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.

Log Your WordPress Emails Now

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.

Dropdown for alias in WP Mail SMTP Wizard

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.

If this article helped you out, please follow us on Facebook and Twitter for more WordPress tips and tutorials.

Comments

  1. Does WPmailSMTP track emails from other plug ins we use? And from our Gmail account? For example, I’m also using Membership Pro Ultimate WP plug in so users can sign up without a WordPress account. That plugin sends emails like welcome, registration, your subscription is about to expire, etc. Then from my Gmail account I will send follow up emails like hey did you download us to your phone yet, or hey what are your thoughts on the app ?

    1. Hi Amer,

      Great question! WP Mail SMTP does not track other plugins or your Gmail account. However, all of the emails that are sent out from your website with the WordPress default wp_mail() will be routed through the WP Mail SMTP configured mailer.

      For example, if you have WPForms on your site and it is set to send out a notification when the form is complete, WP Mail SMTP does not detect that WPForms is on your site. Instead, it helps ensure that those notifications get sent out properly using the mailer you’ve selected.

      I hope this helps!

      Thank you 🙂

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.