Contact form can’t recognise UTF-8 greek language

I'm dealing with an issue about Greek language. When I click on send button the letters I see in my email is just like this åôÜöáóáé.

I aldready have tried:

 1. php: header('Content-type: text/html; charset=utf-8');
    2. html: <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    3 html: <form role="form" action="contact.php" method="post" accept-charset="UTF-8">

What can I do to fix this problem? Thanks!!!

HTML

    <form role="form" action="contact.php" method="post" > 
    <div class="col-md-4">
    
    <input type="text" name="name" placeholder="Fullname *">
    <input type="text" name="email" placeholder="Email *">
    <input type="text" name="subject" placeholder="Subject*">
    <textarea name="message" placeholder="Message *"></textarea>

    <button type="submit" name="submit" value="Submit"> Send</button>
    </div>
     </form>


PHP
  <?php header("Content-type: text/html; charset=utf-8"); 
    
    $name = $_POST['name'];
    $email = $_POST['email'];
    $subject = $_POST['subject'];
    $message = $_POST['message'];
    
    $formcontent=" Name: $name \n Email: $email \n Subject: $subject \n Message: $message";
    
    $recipient = "domain@company.com";
    $subject = "Contact Form";
    $mailheader = "From: $email \r\n";
    
    mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
    
    ?>


Read more here: https://stackoverflow.com/questions/68490151/contact-form-cant-recognise-utf-8-greek-language

Content Attribution

This content was originally published by ric12g at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: