Hi,
so I have a script that sends out HTML emails written in PHP. The code must be fine because the HTML content renders well when sent to Gmail account or even to other major email providers. There is however one local email provider that cant display the exact same email content. Instead displays HTML code in plain text.
What went wrong?
$to = email@email.com;
$boundary = uniqid('np');
$subject = RemoveCzech($_POST['subject']);
$message = "\r\n\r\n--" . $boundary . "\r\n";
$message .= "Content-type: text/html;charset=utf-8\r\n\r\n";
$message .= "<h2>".$_POST['subject']."</h2>";
$message .= TransformTags($_POST['content']);
$message .= "<br /><br /><br /><br /><p>Pokud si přejete pozastavit zasílání emailů, můžete tak provést - <a href='".$path."/contact'>zde</a></p>";
$message .= "\r\n\r\n--" . $boundary . "--";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "From: ".RemoveCzech(SITE_NAME)." <podpora@".RemoveCzech(SITE_NAME).">\r\n";
$headers .= "Subject: ".$subject."\r\n";
$headers .= "Content-Type: multipart/alternative;boundary=" . $boundary . "\r\n";
mail($to, $subject, $message, $headers);