I have a script that sends a multipart email from a php page.
The script appears to work fine on my mail client (Mail on Mac OSX) and on an online email reader (mail2web.com).
However a colleague using Outlook on Windows 2003 views the whole email (ie the raw code - both the text only and the HTML) and when I sent an email to his hotmail account, hotmail simply displayed a blank page.
My client is getting quite frantic about this so if anyone has any suggestions, I'd be very grateful.
This is the script I am using:
$to="Matt MacLeod <[EMAIL PROTECTED]>";
$from="Vinciane Rycroft <[EMAIL PROTECTED]>";
$subject="London 21 Newsletter";
$mime_boundary="==Multipart_Boundary_x".md5(mt_rand())."x";
$headers = "From: $from\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type:multipart/alternative;\n" .
" boundary=\"{$mime_boundary}\r\n\"";
$headers.= "From: $from\r\n";
$message = "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type: text/plain; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$nonhtml ."\n" .
"--{$mime_boundary}\n" .
"Content-Type: text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$htmlVersion;
if (mail($to, $subject, $message, $headers))
echo "Message Sent!";
else
echo "Failed to send message.";-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

