Getting spam blocked with mail(), help please!
Posted: Mon Jul 14, 2008 12:34 pm
I'm using a custom function to send mail here:
But I can't seem to get past yahoo's spam blocker. Is there a best practice for php mail? I've done a bunch of googling on this but can't find anything definitive.
Code: Select all
function emailSend($aTo,$from,$subject,$message)
{
$fMessage = "<html>
<head>
<title>$subject</title>
</head>
<body>";
$fMessage .= $message;
$fMessage .= "</body>
</html>";
foreach($aTo as $to){
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: New Account <'.$to.'>' . "\r\n";
$headers .= 'From: '.$from['name'].' <'.$from['email'].'>' . "\r\n";
mail($to, $subject, $fMessage, $headers);
}
}