I've now set everything to utf-8.
?php
// initialize variables for To and Subject fields
$to = 'info@testmail.nl';
$subject = 'Een testmail';
$from = $_POST["from"];
$email = $_POST["email"];
$comments = $_POST["comments"];
// build message body from variables received in the POST array
$message = "Van: $from \n\n";
$message .= "Email: $email \n\n";
$message .= "Bericht: $comments";
$message = stripslashes($message);
//convert flash line breaks
$message= str_replace("\r", "\n", $message);
$message=nl2br($message);
// add additional email headers for more user-friendly reply
$additionalHeaders = "MIME-Version: 1.0\r\n";
$additionalHeaders .= "Content-type: text/html; charset=UTF-8\r\n";
$additionalHeaders .= "From: $from < $email >\r\n";
$additionalHeaders .= "Reply-To: $email\r\n";
// send email message
$OK = mail($to, $subject, $message, $additionalHeaders);
// let Flash know what the result was
if ($OK) {
echo 'sent=OK';
}
else {
echo 'sent=failed&reason='. urlencode('Er is een probleem met de server. Probeer het later nog eens.');
}
?>
When I view a mail in text mode, the message part works like it should: René stays René. The from field is still displaying RenX. I think that's because the from field is really html even if the mail is in text mode?
When I vie a mail in html mode, the message field screws up to. The from field still says RenX and the message reads rené, where both should display René.
So I think it's a html issue? How do I make é display as é when everything is in html? Meaning the from-field, cc-field, message field etc.