• Resolved gleenk

    (@gleenk)


    Hi,

    I’m reporting a fatal error that occurs with Post SMTP 3.9.5 on WordPress 7.

    The issue happens when the error log option is enabled in the plugin settings.
    If I keep the error logging option active and try to send a test email, WordPress returns a fatal error.

    The relevant part of the error log is:

    [30-Jun-2026 13:24:40 UTC] PHP Fatal error: Uncaught Error: Call to undefined function error_log() in /wp-content/plugins/post-smtp/Postman/PostmanLogger.php:59
    Stack trace:
    #0 /wp-content/plugins/post-smtp/Postman/PostmanLogger.php(43): PostmanLogger->printLog('Exception code=...', 40000, 'ERROR')
    #1 /wp-content/plugins/post-smtp/Postman/PostmanWpMail.php(359): PostmanLogger->error('Exception code=...')
    #2 /wp-content/plugins/post-smtp/Postman/PostmanWpMail.php(67): PostmanWpMail->sendMessage(Object(PostmanMessage), Object(PostmanEmailLog))
    #3 /wp-content/plugins/post-smtp/Postman/Phpmailer/PostsmtpMailer.php(145): PostmanWpMail->send(...)
    #4 /wp-includes/pluggable.php(628): PostsmtpMailer->send()
    #5 /wp-content/plugins/post-smtp/Postman/Postman-Send-Test-Email/PostmanSendTestEmailController.php(357): wp_mail(...)
    #6 /wp-includes/class-wp-hook.php(341): PostmanSendTestEmailAjaxController->sendTestEmailViaAjax('')
    #7 /wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters('', Array)
    #8 /wp-includes/plugin.php(522): WP_Hook->do_action(Array)
    #9 /wp-admin/admin-ajax.php(192): do_action('wp_ajax_postman...')
    #10 {main}
      thrown in /wp-content/plugins/post-smtp/Postman/PostmanLogger.php on line 59

    It looks like the plugin calls the PHP error_log() function directly inside:

    /wp-content/plugins/post-smtp/Postman/PostmanLogger.php:59

    However, on this hosting environment the error_log() function appears to be unavailable or disabled, so the plugin triggers a fatal error instead of handling the missing function gracefully.

    Could you please check whether the logger can verify that error_log() exists before calling it?

    For example, something like:

    if (function_exists('error_log')) {
        error_log($message);
    }

    Or alternatively fall back to another logging method when the function is unavailable.

    At the moment, the workaround is to disable the plugin error log option, but it would be useful if the plugin could avoid a fatal error in this case.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support M Aqib Khan

    (@aqibkhan9)

    Hi @gleenk,

    Thank you for reporting this in detail.

    I’ve forwarded this to our development team for further assessment. They’ll review the PostmanLogger.php file and look into adding a function_exists('error_log') check (or a graceful fallback) before the function is called.

    I’ll update you here once I hear back from them.

    In the meantime, disabling the error log option in the plugin settings is the recommended workaround to avoid the fatal error.

    Thanks for your patience!

    Plugin Support M Aqib Khan

    (@aqibkhan9)

    Hi @gleenk,

    Our development team has fixed this issue. The root cause was exactly what you identified: error_log() was being called without checking if the function exists first.

    We’ve added a function_exists(‘error_log’) check in PostmanLogger.php and a graceful fallback when the function is unavailable.

    Could you please download the beta version and test it on your setup?

    Download the beta

    Once you’ve had a chance to test, please let us know how it goes. If everything looks good, we’ll roll this fix into the next stable release.

    Thread Starter gleenk

    (@gleenk)

    It works!

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.