• We value your experience with Plesk during 2025
    Plesk strives to perform even better in 2026. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2025.
    Please take this short survey:

    https://survey.webpros.com/

PHP mail() function stopped workin

Byron R

New Pleskian
Hi guys, I am running Plesk 12 on a Centos 6.5 box with OVH, I am currently having trouble with the mail() feature of PHP. For some reason any forms using mail() are not sending the mail, the form is saying that it is sent, however the mail never arrives.

Sendmail is enabled in the php.ini file and is linked to the correct directory, also sendmail works on the command line and delivers the messages both internally to domains and externally to mail providers. It is not generating any errors in the domain error_log file nor in php error logs. I have exhausted all options with this, including overwriting postfix with qmail and back.
 
You could try to modify your mail forms with:
PHP:
<?php
ini_set('error_reporting', E_ALL);
error_reporting(E_ALL);
.....

so that it forces to reply with some decent informations in the error - logs of what's going wrong. You could as well check your PHP - ini's for some failures, if they are domain specific ( /var/www/vhosts/system/YOURDOMAIN.COM/etc/php.ini ).
 
Byron R,

It is good idea to check if the mail actually accepted by your mail server. Please check the mail system log /var/log/maillog
you should look for entries:
  • postfix-local: from=www-data ...
  • postfix/pipe ... status-sent
 
Back
Top