Hi there, I have just installed PHP as a DSO for Apache on two separate Linux systems. One uses sendmail and the other uses qmail. Both servers are able to send messages from the command line and from a Perl based form mailer. However, neither one of them can send mail from a PHP script using the mail() function. The php.ini files both have the correct paths set for the binaries. Here is the simple script I am using to test:
<head><title>Mail delivery</title></head>
<?php
$to="someaddres@somedomain.com";
$subject="PHP Mail Test";
$msg="Just testing mail from PHP";
$from="From: anotheraddress@anotherdomain.com";
mail("$to","$subject","$msg","$from");
echo "Mail sent to $to";
?>
I've used several combinations of addresses for the To: and From: fields. I've used local addresses and remote addresses. I've tried it with and without the quotes in the mail(); line. I've even tried using the fifth parameter of "-faddres@domain.com" The script apparently works properly, as no error messages are reported. The only output I get from the browser is the 'echo' line.
Is there something I'm missing when it comes to configuring PHP to send mail? If any further info is needed, please let me know.
Thanks in advance.