I know that this problem has arisen many times in the forum, but I've looked at all the answers and still can't get get the thing to work.
I am trying to send an HTML e-mail from a PHP script on the server, but what I get in the e-mail client (Outlook Express) is just the source code of the HTML (OE is set to receive HTML mail). This is what I am doing:
<?php
$from="A Person";
$recipient="someone-else@elsewhere.com";
$subject="Test e-Mail";
$separator=md5(uniqid(time()));
$headers="From: $from\n";
$headers.="MIME-Version: 1.0\r\n";
$headers.="Content-Type: multipart/alternative; charset=\"iso-8859-1\"; boundary=\"$separator \"";
$headers.="\r\n\r\n";
$headers.="This is a multi-part message in MIME format.";
$headers.="\r\n\r\n";
$body_message="--$separator\r\n";
$body_message.="Content-Type: text/html; charset=\"iso-8859-1\"\r\n";
$body_message.="Content-Transfer-Encoding: 8bit\r\n\r\n";
$body_message.="\r\n\r\n";
$body_message.=<<<QTE
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=iso-8859-1">
<html>
<head>
</head>
<body>
<p><b>Message</b></p>
<p> </p>
</body>
</html>
QTE;
$body_message.="--$separator--";
mail($recipient, $subject, $body_message, $headers);
?>
Any help greatly appreciated.