Sifodyas
August 9th, 2006, 01:09 PM
I was implementing the tutorial-based code and was having no end of difficulty working out why I was not receiving the emails.
So, one thing I tried was to directly call up the email.php file by typing in the full path and it seems that if I do a if (mail(....)) check that it returns a false result suggesting that the mail command failed.
<?php
$email = "noone@nowhere.com";
$name = "no one";
$sentTo = "**mygmailaccount**";
$subject = "test subject";
$headers = "From: " . $name . "<" . $email . ">\r\n";
$headers .= "Reply-To: " . $email . "\r\n";
$headers .= "Return-Path: " . $email;
$message = "this is a test";
if (mail($sendTo, $subject, $message, $headers))
{
echo "Message was sent.";
}
else
{
echo "Message was not sent?!";
}
?>
Each time I call the email.php directly, I get the Message was not sent response.
I've setup a phpinfo file here (http://www.birkvideo.com/proof/test.php), but I'm not sure how to validate any of this.
Different email accounts (which are operating fine) were tried.
I've already gone through the forum archives and can not see a solution, so I really could do with some help on this one.
Any help would be greatly appreciated.
Cheers.
So, one thing I tried was to directly call up the email.php file by typing in the full path and it seems that if I do a if (mail(....)) check that it returns a false result suggesting that the mail command failed.
<?php
$email = "noone@nowhere.com";
$name = "no one";
$sentTo = "**mygmailaccount**";
$subject = "test subject";
$headers = "From: " . $name . "<" . $email . ">\r\n";
$headers .= "Reply-To: " . $email . "\r\n";
$headers .= "Return-Path: " . $email;
$message = "this is a test";
if (mail($sendTo, $subject, $message, $headers))
{
echo "Message was sent.";
}
else
{
echo "Message was not sent?!";
}
?>
Each time I call the email.php directly, I get the Message was not sent response.
I've setup a phpinfo file here (http://www.birkvideo.com/proof/test.php), but I'm not sure how to validate any of this.
Different email accounts (which are operating fine) were tried.
I've already gone through the forum archives and can not see a solution, so I really could do with some help on this one.
Any help would be greatly appreciated.
Cheers.