I have small problem with my php contact form code. I have my site using diacritics which does work perfectly. But my contact form input after submitting looks like this "ÄÅ¡Å" after using any [0-9] keys for diacritics.
PHP file:
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$service = $_POST['service'];
$message = $_POST['message'];
$from = $name;
$to = 'info@email.com';
$subject = "$name - $service";
$body = "Jméno zákazníka: $name\nE-Mail zákazníka: $email\nTelefonní číslo: $phone\nservice: $service\nZpráva: $message ";
if (mail ($to, $subject, $body, $from, $headers)) {
$headers = array("Content-Type: text/html; charset=UTF-8");
} else {
echo "Failed";
}
?>
Email Output after submitting the contact form:
First Last Name
Jméno zákazníka: Name
E-Mail zákazníka: email
Telefonní císlo: phone number
service: havárii
Zpráva: ÄÅ¡Å
the "headers" as name, email, phone, service, message is written with diacritics BUT then the input for example here: Zpráva: ÄÅ¡Å is not supported for some reason.
Also the html file include
<meta charset="utf-8">
UPDATE 1
Have tried to put $headers = array("Content-Type: text/html; charset=UTF-8"); before the contact form is submitted but no change were made. Still doesnt support any of these characters: ě š č ř ž ý á í é
MORE INFO
Adding also the html part where the problem is mostly visible
<div class="col-lg-12">
<textarea name="message" id="" cols="30" rows="10" placeholder="Zpráva">
</textarea>
</div>