Hello,

on 01/07/2005 01:33 AM Kimmo Alm said the following:
Hey again!

I'm having major trouble using mail() to deliver UTF-8 e-mails.

They get sent and delivered successfully, but seem to be... messed up when they arrive (they go through my ISP's relay e-mail server).

My headers basically look like this: "From: Test <[EMAIL PROTECTED]>\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\n".

I want to be able to use UTF-8 chars both in the subject and the body.

When I check the letters in my e-mail client (Opera's built-in one -- M2), it shows "UTF-16". Also, the headers look different than from the ones I send.

Is the relay server altering my letters? What the hell is happening?

When you use UTF-8 encoding it may end up including 8 bit characters. In this case you need to use quoted-printbale encoding to compose the message body and some MTA may filter the unencoded 8 bit bytes . For the headers it is the same except the encoding is q-encoding.


If you do not know how to encode messages with quoted-printable and q-encoding, you may want to try this popular MIME message composing and sending class. Just specify that the default encoding charset is utf-8 and it will be sent without corruption:

http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to