<?php
// Example$HTML = "
<span style=\"color:#FF0000; font-size:22px; font-weight:bold;\">This is a test send html e-mail</span>";
$from = "abc@yahoo.com";
$to = "your_email@yahoo.com";
$subject = "I'm sending a test HTML email";
{
// First we have to build our email headers
// Set out "from" address
// Now we specify our MIME version
$headers .= "MIME-Version: 1.0\r\n";// Create a boundary so we know where to look for
// the start of the data
// First we be nice and send a non-html version of our email
$headers .= "Content-Type: multipart/alternative;".
"boundary = $boundary\r\n\r\n";
$headers .= "--$boundary\r\n".
"Content-Type: text/plain; charset=ISO-8859-1\r\n".
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode(strip_tags($HTML)));
$headers .= "--$boundary\r\n".
"Content-Type: text/html; charset=ISO-8859-1\r\n".
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode($HTML));
mail($to,$subject,"",$headers);
echo("email has been sent...!");
}
1 comment:
Simple demo plus working tutorial at Jose's Blog
Post a Comment