I would like to send some special characters (like é, à, ü,…) by using the PHP mail() function. I tried this: (just a fragment of the code)
$headers = 'From: info@something.be';
$header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n";
$to = "me@gmail.com";
$subject = 'Confirmation de commande';
$message = "Bonjour $firstname";
if (mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $headers)) {...
But for some reason, all I get is things like sâélève. Advice?
Make sure you set your internal encoding to UTF8 with iconv_set_encoding.