Hi
I have the following code which sends out emails to people who subscribe to my site. It prints to a log file output in the format
mail success mail@xyz.com.au
mail failure mail2@xyz.com.au
Some mails succeed but many mails fail including my own which I know is a valid email address. To make it even more confusing, sometimes mails to my address fail and sometimes they succeed. Does any one have any ideas how I can troubleshoot this further to see why the sending of mail is failing to some vaild email addresses.
while ($row = mysql_fetch_array($res2)) {
$email_addr = $row[0];
$fullmessage = $message . "
Unsubscribe Below
:: " . BASEHREF . “unsubscribe.php?email=” . $email_addr . "
-------------------------------------------------------" . $counter;
$Subject = “Fresh, Free & Lovin’ It! " . $title;
$retcode = mail(”$email_addr", “$Subject”, $fullmessage, $headers);
if ($retcode)
{
$retmessage = “mail success”;
}
else
{
$retmessage = “mail failure”;
}
$stringData = $retmessage . " " . $email_addr . "
";
fwrite($LFfh, $stringData);