When I try to send a HTML encoded email from PHP, if the subject line contains special chars like "Here's the information you requested"
, PHP encodes it to read "Here's the information you requested."
How do I fix this?
Here's what the code looks like using PHP mail():
$headers = 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
$headers .= 'To: ' . $mod_params['name'] . '<' . $mod_params['email'] . '>' . "
";
$headers .= 'From: <do_not_reply@a4isp.com>' . "
";
$email_to = $mod_params['email'];
$email_sub = "Here's the Information You Requested";
$body = html_entity_decode("<html><body>" . $email_html_body . "</body></html>");
mail($email_to,$email_sub,$body,$headers);
It gives the same error as running it through the SugarPHPMailer class.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…