Platinum Partner

PHP HTML Email

PHP HTML Email


//define the receiver of the email
$to = "name@domain.com";
//define the subject of the email
$subject = 'Subject';
//create a boundary string. It must be unique
//so we use the MD5 algorithm to generate a random hash
$random_hash = md5(date('r', time()));
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: website@domain.com\r\nReply-To: name@domain.com";
//add boundary string and mime type specification
$headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\"";
//define the body of the message.
ob_start(); //Turn on output buffering
?>
--PHP-alt- 
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

HTML Content HERE

--PHP-alt---
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}