Sending PHP Mail with HTML in Body

This program can be used to send automated e-mails.

I use this program to send e-mails during the registration process on websites.

It supports HTML as well means you can add HTML Tags to the mail body:

$msg = <<<EOPAGE
Hello,<br /><br />
<strong>My Name :</strong> Only For testing<br />
<strong>Email :</strong><br />
<strong>Message :</strong> hello this is for testing only
<br />
$to = '';
$from = '';
$subject = "Subject goes here…..";
$headers = 'MIME-Version: 1.0' . "rn";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
$headers .= 'From: Name <>' . "rn";
$headers .= '' . "rn";
$headers .= 'X-Mailer: PHP/' . phpversion() . "rn";
mail($to, $subject, $msg, $headers);

you can use more headers to the e-mail.

Share this post