Title: Error when disable_functions=mail
Last modified: March 17, 2025

---

# Error when disable_functions=mail

 *  Resolved [acuarel](https://wordpress.org/support/users/acuarel/)
 * (@acuarel)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/error-when-disable_functionsmail/)
 * 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):
 *     ```wp-block-code
       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:880Stack 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:
 * ![](https://i0.wp.com/iili.io/3ng1ODF.jpg?ssl=1)
 * 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](https://wordpress.org/support/users/acuarel/)
 * (@acuarel)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/error-when-disable_functionsmail/#post-18365150)
 * 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', 'utf8mb**4**_unicode_ci')`
   and all solved.
 *  Plugin Support [Shawon Chowdhury](https://wordpress.org/support/users/shawon001/)
 * (@shawon001)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/error-when-disable_functionsmail/#post-18368616)
 * Hi [@acuarel](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/wp-mail-smtp/assets/icon-256x256.png?rev=1755440)
 * [WP Mail SMTP by WPForms - The Most Popular SMTP and Email Log Plugin](https://wordpress.org/plugins/wp-mail-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-mail-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-mail-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-mail-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-mail-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-mail-smtp/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Shawon Chowdhury](https://wordpress.org/support/users/shawon001/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/error-when-disable_functionsmail/#post-18368616)
 * Status: resolved