Email Log WordPress Plugin, allows you to log all emails that are sent through WordPress.
This Plugin is also MU compatible and can be used in WordPress MU installations too.
Download
You can download the Plugin as a zip file from the official WordPress Plugin repository . The source code of the Plugin is available at Github. If you want to contribute to the Plugin, then fork it and send me a pull request.
Installation
Normal WordPress installations
Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.
WordPress MU installations
Extract the zip file and drop the contents in the wp-content/plugins/ directory or mu-plugins directory of your WordPress MU installation and then activate the Plugin from Plugins page of the main blog.
Features
Viewing logged emails
The logged emails will be stored in a separate table and can be viewed from the admin interface. While viewing the logs, the emails can be filtered or sorted based on the date, to address, subject etc.
Deleting logged emails
In the admin interface, all the logged emails can be delete in bulk or can also be selectively deleted based on date, to address, subject. You can also selected email logs individually and then delete them.
Forward email (Pro addon)
You can buy the Forward email pro addon, which allows you to send a copy of all the emails send from WordPress, to another email address. The addon allows you to choose whether you want to forward through to, cc or bcc fields. This can be extremely useful when you want to debug by analyzing the emails that are sent from WordPress.
The cost of the addon is $15 and you can buy it through paypal, by clicking the “Buy now” button.
Cleaning up db on uninstall
As recommended by Ozh , the Plugin has uninstall hook which will clean up the database when the Plugin is uninstalled.
Screenshots
The following screenshot shows how the logged emails will be displayed
![]()
This screenshot shows how the email logs could be filtered or sorted.
This one shows how the email logs could be deleted.
Translation
- German (Thanks Frank)
- Lithuanian (Thanks Vincent G, from http://www.host1free.com )
- Dutch (Thanks Zjan Preijde)
The pot file is available with the Plugin. If you are willing to do translation for the Plugin, use the pot file to create the .po files for your language and let me know. I will add it to the Plugin after giving credit to you.
Feedback
If you have any comments or if you want to report any bugs, please leave a comment below or contact me in twitter .
Stay updated
I would be posting updates about this Plugin in my blog and in Twitter. If you want to be informed when new version of this Plugin is released, then you can either subscribe to this blog’s RSS feed or follow me in Twitter.
Say Thank you
If you find this Plugin useful or like it and wanted to say thank you, then there are ways to make me happy
and I would really appreciate if you can do one of those.
TODO for Future releases
The following are the features that I am thinking of adding to the Plugin, when I get some free time. If you have any feature request or want to increase the priority of a particular feature, then let me know.
- Add JavaScript to do un/select all
- Revamp the Admin UI, by following this technique
- Add option to automatically delete the logs periodically
- Make it MU compatible
- Add the ability to view the entire email
- Add the ability to resend the emails
Changelog
v0.1 (2009-10-08)
- Initial Release
v0.2 (2009-10-15)
- Added compatibility for MySQL 4
v0.3 (2009-10-19)
- Added compatibility for MySQL 4 (Thanks Frank)
v0.4 (2010-01-02)
- Added German translation (Thanks Frank)
v0.5 (2012-01-01)
- Fixed a deprecation notice
v0.6 (2012-04-29) (Dev time: 2 hours)
- Added option to delete individual email logs
- Moved pages per screen option to Screen options panel
- Added information to the screen help tab
- Added Lithuanian translations
v0.7 (2012-06-23) (Dev time: 1 hour)
- Changed Timestamp(n) MySQL datatype to Timestamp (now compatible with MySQL 5.5+)
- Added the ability to bulk delete checkboxes
v0.8 (2012-07-12) (Dev time: 1 hour)
- Fixed undefined notices – http://wordpress.org/support/topic/plugin-email-log-notices-undefined-indices
- Added Dutch translations
v0.8.1 (2012-07-23) (Dev time: 0.5 hour)
- Reworded most error messages and fixed lot of typos
v0.9(2013-01-08) – (Dev time: 1 hour)
- Use blog date/time for send date instead of server time
- Handle cases where the headers send is an array
v0.9.1 (2013-01-08) – (Dev time: 0.5 hour)
- Moved the menu under tools (Thanks samuelaguilera)
v0.9.2 (2013-03-14) – (Dev time: 0.5 hour)
- Added support for filters which can be used while logging emails
v0.9.3 (2013-04-01) – (Dev time: 0.5 hour)
- Moved table name into a separate constants file
v1.0 (2013-04-17) – (Dev time: 0.5 hour)
- Added support for buying pro addons
v1.1 (2013-04-27) – (Dev time: 0.5 hour)
- Added more documentation
Changelog
- 2009-10-08 – v0.1 – Initial Release
- 2009-10-15 – v0.2 – Added compatibility for MySQL 4
- 2009-10-19 – v0.3 – Added compatibility for MySQL 4 (Thanks Frank)
- 2010-01-02 – v0.4 – Added German translation (Thanks Frank)
- 2012-01-01 – v0.5 – Fixed a deprecation notice
- 2012-04-29 – v0.6 (
Dev time: 2 hours)- Added option to delete individual email logs
- Moved pages per screen option to Screen options panel
- Added information to the screen help tab
- Added Lithuanian translations
- 2012-06-23 – v0.7 (
Dev time: 1 hour)- Changed Timestamp(n) MySQL datatype to Timestamp (now compatible with MySQL 5.5+)
- Added the ability to bulk delete checkboxes
- 2012-07-12 – v0.8 (
Dev time: 1 hour)- Fixed undefined notices – http://wordpress.org/support/topic/plugin-email-log-notices-undefined-indices
- Added Dutch translations
- 2012-07-23 – v0.8.1 (
Dev time: 0.5 hour)- Reworded most error messages and fixed lot of typos
-
2013-01-08 – v0.9 (
Dev time: 1 hour)- Use blog date/time for send date instead of server time
- Handle cases where the headers send is an array
-
2013-01-08 – v0.9.1 (
Dev time: 0.5 hour)- Moved the menu under tools (Thanks samuelaguilera)
-
2013-03-14 – v0.9.2 (
Dev time: 0.5 hour)- Added support for filters which can be used while logging emails
-
2013-04-01 – v0.9.3 (
Dev time: 0.5 hour)- Moved table name into a separate constants file
-
2013-04-17 – v1.0 (
Dev time: 0.5 hour)- Added support for buying pro addons
After installation the table doesn’t exist. When I try to create it with phpMyAdmin I get this error message: Too big column length for column ‘subject’ (max = 255). Use BLOB instead.
Frank
@Frank,
Thanks for reporting the issue. I guess it is related to the version of MySQL. I had access to only MySQL 5, so tested it only in that. Would be really helpful for me to fix it, if you could let me know the version of MySQL. You can find it in phpMyAdmin itself.
You are right: the version is 4.0.27.
@Frank,
Thanks for confirming the MySQL version number. I will modify the table creation script to make it work in MySQL 4 also.
@Frank,
I have released an updated version (v0.2) of the Plugin which fixes the issue with MySQL 4. Try it out and let me know if it works for you.
Thanks for reporting the issue.
Thank You for working on this problem.
But the is a new error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘CURRENT_TIMESTAMP, UNIQUE KEY id (id)’
Frank
@Frank,
Thanks for helping me to fix the compatibility issue with MySQL 4. I have released a new version of the Plugin with the fixes.
the instructions seem wrong to me. dropping a folder into mu-plugins usually does nothing…
if I only activate it for the main blog, will I see all emails that have been sent on the whole wpmu installation?
@Ovidiu,
Thanks for pointing it out. I am not very much familiar with WordPress MU, so it may be wrong. I will test it again and will change the instructions.
Hi,
Just wondering if in future developments we can look at the body of what was in the email, inside the wordpress admin panel, as opposed to having to look it up in the MySQL database?
Using Firefox so don’t know if something is missing or if I am missing something? LOL
Good app though, love it
Yeah, it there in my todo list, will work on it when I get some free time.
Love your plugin! Just checking to see if you’ve managed to work anything on this? Would be a great addition, especially for community sites that require moderation like sites running BuddyPress which is increasing rapidly in popularity.
another weird story is that I just sent out an email to all registered users of my formerly wpmu based, now wp 3.0.1 multi-site enabled blogging platform and your email says I sent a whole bunch of emails to no recipient? See screen shot please: http://screencast.com/t/MDQwYzBlMTgt
Thanks for pointing it to me. Will try to fix it when I get some free time.
Great plugin! The only issue I have with it, is that it shows me the server time (CST) and not the time I have set up in WordPress.
Unfortunately, I can’t change the server time, as I am on a shared server.
Is there any workaround to this?
I fixed it in v0.9 of the Plugin. Try out the latest version and it should work
I use it log user contacts (wp_mail is used to send mails to admin)
Question is this logging SQL injection protected?
Yes it is SQL injection protected, since I am using the $wpdb->insert() function
Thank you, for your reply
I updated to the latest version and now it seems like the plugin is not registering new emails in the log and also if I try to delete the logs it will fail. Looking at the PHP errors, I see this: WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘)’ at line 1 for query DELETE FROM wp_email_log where id IN () made by require_once(‘wp-admin/admin.php’), do_action(‘tools_page_email-log’), call_user_func_array, EmailLog->settings_page
I just tried using the latest version of the Plugin and I am not getting any issues.
Can you give me these additional information so that I can debug it?
- MySQL version
- PHP Version
- WordPress Version
- Plugin Version
The issue happened after doing the update from the previous version to the current one. I removed the plugin and reinstalled it and it seems to be doing okay now. Anyways, the PHP is 5.3, WP is 3.4.2, MySQL 5.0, plugin 0.9.1. Thanks.
It is still strange, because I did a update myself and was not facing this issue. Anyways will keep this in mind and see if I can replicate it.
Hello Sudar,
I would like to give a suggestion for your plugin (or maybe another plugin). It would be really nice if we had the option to resend an email that was previously sent.
I have noticed that sometimes WordPress fails to send some emails… a lot of people who use GoDaddy have issues with emails not being delivered. I just recently changed my SMTP to another service other than GoDaddy and so far my WordPress installation failed to send only one email. Your plugin logged the email as sent, but the server failed to actually send the email out.
This would be a really good add-on to your plugin!
Hope you can take this into consideration.
Thanks!
That’s actually a very nice feature to have. The only problem is that my Plugin (or WordPress for that matter) has no way to know whether the email failed or not.
Anyway added it to the TODO list. Will implement it when I get some free time of if someone is ready to sponsor the feature
That would be fantastic, Sudar!
I agree with you, WordPress has no way of knowing if the email was sent or not. In my case, I compare the logs from your plugin with the logs of the SMTP service I use and then I am able to determine if WordPress failed to send any of the emails. If everything is going fine, the number of emails sent that is shown in your plugin matches the number of emails sent showing on my SMTP service. If the numbers are different, I can compare the logs. If your plugin has the feature to resend the email, then I can ask your plugin to attempt to send the email again.
I really appreciate your consideration implementing this feature. I have not seen any other plugin out there that can do this so far.
Thanks!
I want to update the email confirmation of registration, where should I change?
I want to update the email confirmation of registration, where should I change?
This Plugin only allows you to log the emails that are sent from WordPress. You can’t change the email body using this Plugin.