Directory / plugin
MailSentra: Email Logging & Diagnostics
v2.0.2 · by Macro Espias
Logs WordPress email attempts with source diagnostics, reports, search, CSV export, and retention controls.
About this plugin
MailSentra logs WordPress email attempts and records the status, recipient, subject, trigger, caller, call stack, and source details for each message. It provides email statistics, weekly and monthly reports, source-based diagnostics, search and filtering, CSV export, and configurable retention.
Email body, headers, attachment paths, and request IP addresses can be logged when their individual settings are enabled. Body, header, attachment, and IP logging are disabled by default for new installations; enable only the fields needed for troubleshooting. MailSentra stores logged data in the site database and does not send it to an external service.
A “Sent” status means WordPress or PHPMailer reported a successful send operation. It does not confirm final inbox delivery or rule out a later bounce.
Features
- Logs wp_mail() send attempts.
- Records sent/failed result from WordPress mail hooks.
- Dashboard statistics.
- Seven-day activity chart.
- Search and status filtering.
- Detailed individual log view.
- Manual resend as a new attempt from log details when the original message body was captured.
- CSV export.
- Optional body, header, attachment, and request IP logging; these fields are disabled by default for new installations.
- Configurable retention period and optional maximum log count.
- Optional database cleanup on uninstall.
Important
A “Sent” status means WordPress invoked its mail-success hook or a pre-send integration returned true. WordPress invokes the mail-success hook after PHPMailer returns normally, even if its send result is false, so this status does not guarantee successful transport or final inbox delivery. Check your mail provider’s logs for delivery confirmation.
MailSentra writes each log to the WordPress database before the mail attempt and updates its status from WordPress mail hooks. If a log write fails, email sending continues and MailSentra records a generic diagnostic in the PHP error log. Logging depends on the site’s database being available; a database outage or interrupted request can still prevent a log from being stored or leave it pending.
Expired logs are scheduled for cleanup at most once per day when the site receives traffic. Cleanup runs through WP-Cron in batches of up to 500 rows, scheduling follow-up batches as needed. An optional maximum log count removes the oldest records in these batches and is enforced during cleanup, not on each email send. WP-Cron requires site traffic unless a system cron is configured. Set retention days and maximum log count to 0 to disable both automatic deletion limits.
Development
Run php tests/run.php to execute the plugin’s focused standalone checks.