Error when disable_functions=mail
-
Hi!
In our server (PLESK interface) we’ve added the rule
disable_functions=mailon the php config so the system only sends SMTP emails. We’ve been working whit this config without issues in every domain hosted but we have one site that refuses to send email if this flags is active.If php version >= 8.0 for the site, web forms seem to be working flaswlessly on the frontend and tests made on the backend as well, but whenever we want to send a system email from the backend, like password reset email, system throws a 500 error and the log displays somethig like this (hidden domain and IP):
2025/03/17 09:26:45 [error] 387890#0: *3269417 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function PHPMailer\PHPMailer\mail() in /var/www/vhosts/DOMAIN_NAME_HERE.com/httpdocs/wp-includes/PHPMailer/PHPMailer.php:880
Stack trace:
#0 /var/www/vhosts/DOMAIN_NAME_HERE.com/httpdocs/wp-includes/PHPMailer/PHPMailer.php(1968): PHPMailer\PHPMailer\PHPMailer->mailPassthru()
#1 /var/www/vhosts/DOMAIN_NAME_HERE.com/httpdocs/wp-includes/PHPMailer/PHPMailer.php(1691): PHPMailer\PHPMailer\PHPMailer->mailSend()
#2 /var/www/vhosts/DOMAIN_NAME_HERE.com/httpdocs/wp-includes/PHPMailer/PHPMailer.php(1523): PHPMailer\PHPMailer\PHPMailer->postSend()
#3 /var/www/vhosts/DOMAIN_NAME_HERE.com/httpdocs/wp-content/plugins/easy-wp-smtp/src/MailCatcherTrait.php(93): PHPMailer\PHPMailer\PHPMailer->send()
#4 /var/www/vhosts/DOMAIN_NAME_HERE.com/httpdocs/wp-includes/pluggable.php(546): EasyWPSMTP\MailCatcherV6->send()
#5 /var/www/vhosts/DOMAIN_NAME_HERE.com/httpdocs/wp-includes/user.php(3335): wp_mail()
#6 /var/www/vhosts/DOMAIN_NAME_HERE.com/httpdocs/wp-a" while reading response header from upstream, client: XXX.XXX.XXX.XXX, server: DOMAIN_NAME_HERE.com, request: "GET /wp-admin/users.php?action=resetpassword&users=2&_wpnonce=9a16e53daf HTTP/2.0", upstream: "fastcgi://unix:/var/www/vhosts/system/DOMAIN_NAME_HERE.com/php-fpm.sock:", host: "DOMAIN_NAME_HERE.com", referrer: "https://DOMAIN_NAME_HERE.com/wp-admin/users.php?reset_count=0"Setting ph to 7.4 or lower, dos not trigger any error but admin emails (i.e,. password reset) doesnt work and system dispays something like this:

Thought it could be an error with file permission due to hosting migration, but everything seems to be ok
Removing the forementioned php config (disable_functions=mail) seems to bring things to workAny ideas what could be causing the error?
Thank you very much
The topic ‘Error when disable_functions=mail’ is closed to new replies.