Page 1 of 1

french characters getting mangled from html form to php mail

Posted: Mon Aug 09, 2010 5:43 pm
by mjorld
I have looked all over, and it sounds like I am far from the only person to have this problem, yet no one's solution has worked for me :banghead: . I am hoping someone out there has a brilliant solution.

I have an HTML form. Once filled out, the values are taken by some php code using $_POST. These values are then used in a personalized email sent using php's mail(). The problem is that the french characters such as é turn into garbage like é. The HTML begins with
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
and the php has as a header
$headers .= "Content-type:text/html;charset=UTF-8"."\r\n";
Initially I had problems with the hard-coded portions of the email, but replaced é with &#233; etc. That solved that problem. It is just the values that were input by the user and sent to the email body that get converted into garbage.

I have found tons of suggestions in this forum and others and tried most of them with no success. I know there must be a strqight-forward way of doing this.

Any help anyone can provide would be most appreciated.