Hello,
I have been working on a project at my job and they want HTML email capability. My problem comes in that I can send plain text emails and I can send HTML emails but I am having problems doing the multi-part types. I would only ever be sending a text or HTML email so it would never vary. The following code is the closest I have come to what I believe is the way the code is supposed to be:
<?php
$headers = "From: MrTemp <temp@temp.com>\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"unique-boundary-1\";\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
$text .= "--unique-boundary-1\r\n";
$text .= "Content-Type: text/plain; charset=us-ascii\r\n";
$text .= "Content-Transfer-Encoding: 7bit\r\n";
$text .= "This is a test of plain text emails\r\n";
$text .= "--unique-boundary-1\r\n";
$text .= "Content-Type: text/html;\r\n";
$text .= "Content-Transfer-Encoding: 7bit\r\n";
$text .= "This is a test of html text emails.<br><font color=\"#FF0000\">high severity</font>\r\n";
$text .= "--unique-boundary-1--\r\n";
mail("temp@temp.com", "testing", "$text","$headers");
php?>
I am clearly doing something wrong though as my emails come through with no text.
Any help that can be provided will be greatly appreciated,
Aludaan