Tuesday, October 13, 2009

Creating html emails

I have learned how to use php to put html into emails!
This will be useful.
$admin= "emailfrom@gmail.com";
$email = "emailto@gmail.com";
$subject = "HTML in email";
$message = "

";
$headers = "MIME-Version: 1.0\nContent-type: text/html; charset=UTF-8\n";
//$headers = "To: $firstname $lastname <$email>\n";
$headers .= "From: Your Agri-med Perscription <$admin>\n";
$mail = mail($email, $subject, $message, $headers);
if($mail) echo "The email has been send.";
?>

So that is all that is required. There are many email clients out there such as yahoo, gmail, hotmail, outlook
and they all see html in emails differently. They all have different support for html and css. Test your emails out with as many of these as you can to make sure your email styles are supported.

look at this page to learn what your emails look like in different clients and what features each support.
http://www.email-standards.org/clients/

No comments: