Wednesday, March 12, 2008

Sending HTML Mail in PHP

To send HTML mail in php use the following code...

$to = 'some@example.com';
$subject = Testing Html Mail;
$message = '
// HTML code here
';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: Somebody ,' . "\r\n";
$headers .= 'From: Me ' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);


- This is not an Authentication Mail.

No comments: