I really don't understand why when a user send an email request, the subject and the message are perfect (no escape, accents, symbols,..) it's all ok, except for the name and surname!
For example if my user full name is: Test è'ü-x-'zî in my client (MS outlook) i see: Test è'ü-x-'zî
The code to send the email is:
$subject = stripslashes( $subject );
$message = stripslashes( $message );
$headers = "MIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n";
// problem here
$headers .= "From: $user[name]<test@example.com>\nReply-to: $user[name]<$user[email]>\n\n";
@mail( $email, $subject, $message, $headers );
PS: the $user[name] is saved in the DB not in POST, in all my PHP pages i use UTF8:
<meta charset="utf-8">
header( 'Content-Type: text/html; charset=utf-8' );
mysqli_query( $con, "SET NAMES 'utf8'" ) or die( 'Error (charset)' );
how i can resolve? maybe there is a PHP function?