Using PHP mail – setting correct MIME type

# Send Mail format
# Using PHP mail - setting correct MIME type


$to   = "test@gmail.com";
$subject = "Test subject";
$message = "Test message";

// To send HTML mail, the Content-type header must be set
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-type: text/html; charset=iso-8859-1';

// Additional headers
$headers[] = 'To: Mary <mary@example.com>, Kelly <kelly@example.com>';
$headers[] = 'From: Birthday Reminder <birthday@example.com>';
$headers[] = 'Cc: birthdayarchive@example.com';
$headers[] = 'Bcc: birthdaycheck@example.com';

$header_data = implode("\r\n", $headers);



//echo "<pre>";
//print_r($header_data);
//echo "</pre>";

// Mail it
mail($to, $subject, $message, $header_data);


For more information click: http://php.net/manual/en/function.mail.php

Leave a Reply

Your email address will not be published. Required fields are marked *