mail() and popen() falure
| From: | Kenneth Brown | Date: | Thu, 24 Jan 2002 17:05:29 +0000 |
| Subject: | mail() and popen() falure | ||
| Groups: | php.install | ||
| Request: | Send a blank email to php-install+get-5729@lists.php.net to get a copy of this message | ||
would anyone know why
mail(); and popen(); would fail
inside the libphp4.so but execute correctly
from the command line
Apache/1.3.19 (Unix) (Red-Hat/Linux)
mod_ssl/2.8.1
OpenSSL/0.9.6
PHP/4.0.4pl1
<?
$email = "ken@shadowplay.net";
$msg="testing this out";
$subject="testing";
#below all on one line...
$addons = "From: intranet@shadowplay.net\nReply-To:
shadowplay@shadowplay.net\nDisposition-Notification-To:
shadowplay@shadowplay.net\nX-Mailer: PHP/" .phpversion() ;
#above all on one line...
if (mail($email, $subject, $msg, $addons))
{print "mail sent"; }
else
{ print "mail died";}
$outme="Subject: $subject\n";
$outme.= "To: ".$email."\n";
$outme.= $addons."\n";
$outme.= "\n".$msg."\n";
$fp=popen ("/usr/sbin/sendmail -t -i","w");
fwrite($fp,$outme);
pclose($fp);
?>
if above is executed from command line
system accepts mail with no issues...
if run from within the apahce server.. executes
returns "mail died"
and the following in logs....
qmail-inject: fatal: read error
qmail-inject: fatal: read error
any help would be appreciated...
kenneth gf brown
ceo shadowplay.net