How can I use HTML with the mail script?

Does anyone know because when i do the html code and then send the script the code just shows up with the email

Im talking about the php mail(); script

This is from the PHP help:

/* recipients */
$to = “Mary <mary@example.com>” . ", " ; // note the comma
$to .= “Kelly <kelly@example.com>”;

/* subject */
$subject = “Birthday Reminders for August”;

/* message */
$message = ’
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';

/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0
";
$headers .= "Content-type: text/html; charset=iso-8859-1
";

/* additional headers */
$headers .= "From: Birthday Reminder <birthday@example.com>
";

$headers .= "Cc: birthdayarchive@example.com
";
$headers .= "Bcc: birthdaycheck@example.com
";

/* and now mail it */
mail($to, $subject, $message, $headers);

note the headers.

on php site, you will find the perfect mail function. sends html, attachments etc