Page 1 of 1

special characters problem in email

Posted: Sun Jun 20, 2010 6:03 am
by itsmani1
Hi,

I am having a problem with characters like " é, å, ø " etc

I have textarea for message, users submit messages and when they use characters like above it does not show correctly in email.

any help?

thank you

Re: special characters problem in email

Posted: Sun Jun 20, 2010 4:40 pm
by Darhazer
First of all make sure that they come correct to the PHP script and the problem is in email only (i.e. output the e-mail to the browser, setting the correct encoding and if the browser is displaying correctly the characters, they are OK).

Second and most important: e-mail is in ASCII format. This means that all characters that are allowed are in the latin alphabet. To send UTF-8 messages, you have to encode your mail in base64, set the Content-Encoding header to base64 and the Content-Type header to text/plain;charset=utf8

The really tricky part is if you want to use special characters in the headers, because you have to encode them as well, but if you use them only in the message body, it's easy task.