¿Como usar mail() para mensajes en HTML?

Rodrigo
19 de Marzo del 2002
Hola!!!

Es una pregunta sencilla para expertos en php como ustedes. Cual es la sintaxis que debo usar para indicar a la funcion mail() que se trata de un mensaje en HTML. Creo que se anexa una cabecera pero no se cual.

De ante mano muchas gracias!!!!

Gustavo
19 de Marzo del 2002
Mira el siguiente codigo es facil de analizar tal vez te sirva de algo:

/* recipients */
$to = "Mary <[email protected]>" . ", " ; //note the comma
$to .= "Kelly <[email protected]>";

/* 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>
<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.0rn";
$headers .= "Content-type: text/html; charset=iso-8859-1rn";

/* additional headers */
$headers .= "From: Birthday Reminder <[email protected]>rn";

$headers .= "Cc: [email protected]";
$headers .= "Bcc: [email protected]";

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