mail function not working
Hello,
I am unable to send using mail() function. Please see the details.
========
Test mail php file.
]# cat testmail.php
if (mail('tewstuhidw9j@gmail.com', 'PHP test', 'This is a test of mail().')) {
echo "Mail successful";
} else {
echo "Mail failed.";
};
?>
Browser output :Mail failed.
==========
Apache Error log:
sh: /usr/local/bin/sendmail-logger: No such file or directory
# ll /usr/local/bin/sendmail-logger
-rwxr-xr-x 1 root root 169 Jun 25 2013 /usr/local/bin/sendmail-logger*
# which sendmail
/usr/sbin/sendmail
#grep sendmail /usr/local/lib/php.ini
;sendmail_from = me@localhost.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path = "/usr/sbin/sendmail -t -i"
sendmail_path=/usr/sbin/sendmail -t ;
;sendmail_path = /usr/local/bin/sendmail-logger
===============
Kindly assist.
Thanks
Sreeni
-
Hello :) Do you notice any error messages in the error_log within the script's directory, or in the Apache error log (/usr/local/apache/logs/error_log)? Which PHP handler are you using? Is "Prevent "nobody" from sending mail" enabled under the "Mail" tab in "Tweak Settings" within WHM? Thank you. 0 -
Hello Michael, The Prevent "nobody" from sending mail" enabled under the "Mail" was enabled. The error message in apache log was 'sh: /usr/local/bin/sendmail-logger: No such file or directory'. I have fixed it by running upcp --force after removing exim from /etc/yum.conf (exclude) . Thanks for your help. Thanks Sreeni 0 -
Hello, Glad you got that worked out and thank you for updating this thread with your solution. 0
Please sign in to leave a comment.
Comments
3 comments