How do I send HTML formatted mail using PHP?

You have to specify that the contents of the mail is HTML:

mail("[email protected]", "subject", "<i>Italic Text</i>", "Content-type: text/html; charset=iso-8859-1");

See example 4 on this page:

http://php.net/manual/en/function.mail.php


You need to have a properly formed html doc:

$msg = "<html><head></head><body><i>Italic Text</i></body></html>";

Edit:

And send headers:

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

mail("[email protected]", $msg, $headers);