Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP mail() function failing silently

Discussion in 'E-mail Discussions' started by MrChook, Jan 10, 2009.

  1. MrChook

    MrChook Registered

    Sep 21, 2004
    Likes Received:
    Trophy Points:
    This has been a problem for a while, I'm not sure exactly how long.

    The mail() function in PHP is just failing silently. The function returns true as if it had worked but nothing ever shows in the exim log. Seems to be a server wide problem, not just restricted to certain accounts.

    All settings look normal,
    • WHM 10.8.0 cPanel 10.9.0-S119
    • CentOS 4.4 i686 - WHM X v3.1.0
    • Prevent the user "nobody" from sending out mail to remote addresses is NOT checked
    • Apache is not configured with PHP suexec but the suEXEC module is enabled.
    • The sendmail path in php is "/usr/sbin/sendmail -t -i" which is correct

    I have written a test script that basically runs this...

    $result = mail($to, $subject, $content, 'From: ' . $from);
    It always returns true and never actually works. Running the equivalent from the command line as any normal user does work so it seems to be some issue with Apache being able to run sendmail.

    Any ideas on what this might be would be appreciated.

Share This Page