• Resolved acuarel

    (@acuarel)


    Hi!

    In our server (PLESK interface) we’ve added the rule disable_functions=mail on 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 work

    Any ideas what could be causing the error?

    Thank you very much

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter acuarel

    (@acuarel)

    Hi

    Nevermind. Some mistake on the wordpress config file
    define( 'DB_COLLATE', 'utf8mb_unicode_ci' )
    was the wrong value, so when it was crashing with error related to wrong db collation.
    Changed to
    define( 'DB_COLLATE', 'utf8mb4_unicode_ci' )
    and all solved.

    Plugin Support Shawon Chowdhury

    (@shawon001)

    Hi @acuarel ,

    Thanks for the update and we are glad that you could solve the issue.

    Have a good one!

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

The topic ‘Error when disable_functions=mail’ is closed to new replies.