Fatal Error
-
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 59It looks like the plugin calls the PHP
error_log()function directly inside:/wp-content/plugins/post-smtp/Postman/PostmanLogger.php:59However, 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.
You must be logged in to reply to this topic.