I'm trying to send html emails but the emails are always received with the actual html tags, not displaying the html properly. I receive html emails from lots of companies, but when I try to send an email from an html form i created with php mail, I never receive the email correctly. I'm not sure what else to try. Any help would be appreciated. Thanks.
in the html of the page I have:
Code: Select all
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
in the php mail part I have this set:
Code: Select all
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$headers .= "MIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
$message ="--{$mime_boundary}\n";
$headers .= "Content-Type: text/html; charset=utf8\r\n";
$message.="Content-Transfer-Encoding: 8bit\n\n";