I've recently setup a new linux web server. I have apache 1.3.26, php 4.2.2 and sendmail 8.12.5. I am running into a problem with my scripts sending out mail. I cannot get them to send out is the problem. I have setup a variable called $sent which is supposed to give me a value of whether it was handed over to sendmail. I have php setup in cgi mode and also a .so in apache. I tell you this because I am able to send out email when I am logged in as root using a command line PHP script.
CGI version:
#!/usr/local/bin/php
<?PHP
$sent = mail("user@domain.com","Test","Body of Message");
print "Sent: $sent\n";
?>
This comes back with Sent: 1, which means it was successful. Now for my regular web based script:
<?PHP
$sent = mail("user@domain.com","Test","Body of Message");
print "Sent: $sent<br>";
?>
This one comes back without true or false. It shows:
Sent:
and that's all.
I'm thinking it must be related to permissions or something, but I have a mail server which is running squirrelmail written in PHP, and it's got the exact same kind of setup, and yet squirrelmail works. (I've not looked into how it works, I'm kind of presuming it uses the mail() command). Does anyone have some good ideas as to why my web based program doesn't seem to work at all.
Thanks
John