Been there for days wraps over the fact that I can create a script that sends HTML mail template, and in case the user has a client who can not read HTML and plain text listing
You should add html and plain text version of email called multipart/alternative
in same email body:
\n";
$headers .= "To: ". $new_to ."\n";
$headers .= "Reply-To: \"". $from. "\" <" . $email . ">\r\n";
$headers .= "Return-Path: <". $email .">\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/alternative;\n boundary=" . $mime_boundary_header ;
$headers .= "\n--$boundary\n"; // beginning \n added to separate previous content
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "\n--$boundary\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding:base64\r\n";
$body = "
--$mime_boundary
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
". strip_tags($messageBody) ."
--$mime_boundary
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding:base64
". chunk_split(base64_encode($messageBody)) ."
--$mime_boundary--";
mail(null,$sub,$body,$headers,"-f".$email);