A simple search and replace fixed the issue
- Code: Select all
$body = str_replace("\r", '', $body);
- Code: Select all
<?php
$notice_text = "This is a multi-part message in MIME format.";
$plain_text = "This is a plain text email.\r\nIt is very cool.";
$html_text = '<html><body><h2>heading</h2><p>paragraph <b>text</b>.</p></body></html>';
$semi_rand = md5(time());
$mime_boundary = "==MULTIPART_BOUNDARY_$semi_rand";
$mime_boundary_header = chr(34) . $mime_boundary . chr(34);
$to = "hotmailsucks@hotmail.com";
$bcc = "";
$from = "Me.com <me@me.com>";
$subject = "My Email";
$body = "$notice_text
--$mime_boundary
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
$plain_text
--$mime_boundary
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
$html_text
--$mime_boundary--";
$body = str_replace("\r", '', $body);
if (@mail($to, $subject, $body,
"From: " . $from . "\n" .
"MIME-Version: 1.0\n" .
"Content-Type: multipart/alternative;\n" .
" boundary=" . $mime_boundary_header))
echo "Email sent successfully.";
else
echo "Email NOT sent successfully!";
?>

