I’m trying to send out a newsletter, but all my messages are being completely blocked by hotmail, the other email servies I tested worked fine.
I searched the forums and read about needing the proper content-type’s and from the examples I looked at, this should be working. I sent several emails using this code, and 2 actually did make it to my hotmail account but no others, despite using the same code.
[code=php]
$MailTitle = “”;
if(isset($_POST[“MailTitle”])){
$MailTitle = $_POST[“MailTitle”];
}
$MailMessage = “”;
if(isset($_POST[“MailMessage”])){
$MailMessage = $_POST[“MailMessage”];
}
$boundary = uniqid(‘np’);
$message = “”;
$headers = ‘From: [email protected]’ . “rn” .
‘Reply-To: [email protected]’ . “rn” .
‘X-Mailer: PHP/’ . phpversion() . “rn” .
“MIME-Version: 1.0rn” .
“Content-Type: multipart/alternative;boundary=” . $boundary . “rn”;
$message .= “rnrn–” . $boundary . “rn”;
$message .= “Content-type: text/plain;charset=utf-8rnrn”;
$message .= $MailMessage;
$message .= “rnrn–” . $boundary . “rn”;
$message .= “Content-type: text/html;charset=utf-8rnrn”;
$message .= $MailMessage;
$message .= “rnrn–” . $boundary . “–“;
mail($Email,$MailTitle,$message,$headers);
$query = “SELECT * FROM TestMailSystem”;
$result = mssql_query($query);
while($row = mssql_fetch_Array($result)){
$Email = $row[“Email”];
mail($Email,$MailTitle,$message,$headers);
}
Does anyone see anything wrong with this code?