Your problem is that mail software assumes that email messages are plain text unless they contain MIME information.
Here's a sample MIME-encoded message for ya:
Content-Transfer-Encoding: 7bit
Content-Type: multipart/mixed; boundary="_---[boundary]---_"
MIME-Version: 1.0
To: [email]someuser@somedomain.com[/email]
From: [email]me@mydomain.com[/email]
Subject: Sample MIME Message
This is a multi-part message in MIME format.
--_---[boundary]---_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain
This is the regular text part of the message.
--_---[boundary]---_
Content-Transfer-Encoding: 7bit
Content-Type: text/html
<html>
<head><title>Blah</title></head>
<body>
<b>This is the HTML part of the message.</b>
</body>
</html>
--_---[boundary]---_--
Doing MIME-encoded email can get pretty complex, but maybe you can get an idea of what needs to be done from that.
First -- you've got to add the first three headers to the email message, so that the mail reader knows that it's getting a MIME message.
Then, you'll want to add the "This is a multi-part message in . . ." message.
All parts of the message are divided with the boundary marker, as defined in the headers. All of the boundary markers except for the final marker have two dashes prepended to them (i.e., if the boundary marker is "---[boundary]---" they will be "-----[boundary]---"). The last boundary marker will also have two dashes appended to it, to let the software know it has reached the end of the message.
Just after the boundary markers (with the exception of the last marker) you will have two lines that tell the reader what format the content that follows is. There must be a blank line between this information and the actual content.
There must be a blank line between the content and the next boundary marker.
Like I said, this can get pretty complex. But, hopefully this will get you going in the right direction. I'll look around and see if I can find any good information on MIME email that might help you -- if I do, I'll post links.
For your particular problem, you'll want to do something like this:
// First, read the information from the HTML file
$str_filename = "answer.html";
$rsrc_file = fopen($str_filename, "r");
$str_contents = fread($rsrc_file, filesize($str_filename));
fclose($rsrc_file);
// Assemble the body of the message
$str_mailbody = "This is a multi-part message in MIME format\n" .
"\n" .
"--_---[boundary]---_\n" .
"Content-Transfer-Encoding: 7bit\n" .
"Content-Type: text/plain\n" .
"\n" .
"Thanks for your reaction!\n" .
"http://www.not-allowed.nl\n" .
"\n" .
"--_---[boundary]---_\n";
"Content-Transfer-Encoding: 7bit\n" .
"Content-Type: text/html\n" .
"\n" .
$str_contents .
"\n" .
"--_---[boundary]---_--\n";
// Send the email
mail( $str_mail_from, "Thanks for your e-mail", $str_mailbody,
"From:tomek@not-allowed.nl",
"Content-Transfer-Encoding: 7bit",
"Content-Type: multipart/mixed; boundary=\"_---[boundary]---_\"",
"MIME-Version: 1.0");
That should do the trick for you.