Hi,
I have a problem where php won't send e-mail when the php page is accessed via a browser.
Sendmail works fine from the command line, the php script even works fine from the command line using php -f testmail.php.
I have a script, a simple script, to test it out:
PHP Code:
<?php
$email = "myemail@anotherisp.com";
$subject = "This is the subject";
$msg = "This is the message";
$from = "From: [email]myemail@myisp.com[/email]";
if (mail($email,$subject,$msg, $from)) {
echo "success!!\n<br>";
} else {
echo "failed\n<br>";
};
?>
When I run it from the linux command line, I get the output:
success!!
When I try to access it via a browser, I get:
failed
Anyone know what's going on?
My last remaining theory is a permissions problem somewhere.