If you want a complete mail sending script, that send in html, this is what you have to use:
//here the receiver of the email
$to = 'receiver@example.com';
//here the subject of the email
$subject = 'Test HTML email';
//create a boundary string. It must be unique
//so we use the MD5 algorithm to generate a random hash
$random_hash = md5(date('r', time()));
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: myemail@mysite.com\r\nReply-To: myemail@mysite.com";
//add boundary string and mime type specification
$headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\"";
//define the body of the message.
$message ='
--PHP-alt-'.$random_hash.'
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
<h2>Hello World!</h2>
<p>This is something with <b>HTML</b> formatting.</p>
--PHP-alt-'.$random_hash.'--';
//send the email
$mail_sent = @mail( $to, $subject, $message, $headers );
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
echo $mail_sent ? "Mail sent" : "Mail failed";
?>
The script is with comments, to tell you what exactly each instruction does :)
So as you see, we added:
Content-Type: text/html; charset="iso-8859-1"
to the message body ($message), this way the mail client of the receiver will know that the email is in html.
There are also few other changements that are nor really very necessary like the boundary string, but it is better to use them :)