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> [email protected]<br />
<strong>Message :</strong> hello this is for testing only
http://www.php.net/manual/en/index.php
<br />
Thanks
EOPAGE;
$to = '[email protected]';
$from = '[email protected]';
$subject = "Subject goes here…..";
$headers = 'MIME-Version: 1.0' . "rn";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
$headers .= 'From: Name <[email protected]>' . "rn";
$headers .= 'Reply-To:[email protected]' . "rn";
$headers .= 'X-Mailer: PHP/' . phpversion() . "rn";
mail($to, $subject, $msg, $headers);

you can use more headers to the e-mail.

Share this post

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on pinterest
Share on print
Share on email