Sending HTML Email from php

Sending HTML Email from php

To send a html emails we need to change the header little bit

We need to add “Content-type: text/html;” in the headers otherwise the mail will show if we include “<br>” or any html things in the email will be shown as we gave in the messages.

Example:
$headers = “From: test@test.com>\r\n”;
$headers .= “MIME-Version: 1.0\r\n”;
$headers .= “Content-type: text/html; charset=iso-8859-1\r\n”;

mail($email,”Test Subject”,”Test Message”,$headers);

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.