mail() returns false every time

From: Date: Wed, 19 Jun 2002 19:12:29 +0000
Subject: mail() returns false every time
Groups: php.general 
Request: Send a blank email to php-general+get-102992@lists.php.net to get a copy of this message
Hi everyone. I was hoping someone could tell me if I'm doing something wrong... I've been debugging this all day. My mail daemon is sendmail, and it is running fine (I have tested it directly from the command line). My OS is Red Hat 7.2, running PHP 4.1.2. My php.ini does indeed have the sendmail_path directive set to /usr/sbin/sendmail, which is where sendmail sits. I have checked this in phpinfo(). In fact, for debugging I have even written a shell script (which is world-executable so the 'apache' user that runs my httpd should have no problem executing it) that writes certain debug info to a file when it is executed. Needless to say, this file is not being created when I execute my PHP script. Here is the relevant part of code: $email_to = 'pricee@hhbrown.com'; $subject = 'This is the subject'; $body = 'This is the body'; print "<p>We are mailing to " . $email_to . "</p>\n"; $mail_returnval = mail($email_to, $subject, $body); print "<p>And the value of mail_returnval is " . (int)$mail_returnval . "</p>\n"; if ($mail_returnval != 1) { die('Mail returnval != 1'); } Sure enough, when I execute the script, the whole thing die()s and the message is this: We are mailing to pricee@hhbrown.com And the value of mail_returnval is 0 Mail returnval != 1 What's going on here? I've heard of mail not going through due to sendmail probs, but I simply can not get the mail() function to run successfully. Any pointers? Thank you, Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com

« previous php.general (#102992) next »