Re: Non-ascii email subject and header encoding
- From: Manuel Lemos <mlemos@xxxxxxx>
- Date: Thu, 29 Mar 2007 00:20:19 -0300
Hello,
on 03/27/2007 06:55 AM Ciuin said the following:
Hi all,
I need to mail() emails with user input that does contain non-ascii
(umlauts, accents) and non-latin (cyrillic) characters in the
"Subject:" and "From:" headers. I understand that they are typically
encoded in UTF8 like this:
=?UTF-8?B?w5Z0emkg0J/RgNC40LLQtdGC?=
but I cannot find a PHP function to encode the input string in this
way. utf8_encode gives me garbled char soup, so what do you use?
That is binary q-encoding. It is not quoted-printable but it is similar
for message headers. There is a whole RFC on that subject.
Yoy may want to try the MIME message that can be used to compose and
send messages and supports headers with non-ASCII characters encoded as
UTF-8 or any other encoding.
Take a look at the test_multibyte_message.php example script. It
explains how to send messages in Japanese with encoding ISO-2022-JP, but
you can change that for UTF-8 to support characters of all idioms.
http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
.
- References:
- Non-ascii email subject and header encoding
- From: Ciuin
- Non-ascii email subject and header encoding
- Prev by Date: Re: best FTP client for coding PHP
- Next by Date: Re: cURL and Loading Pages
- Previous by thread: Re: Non-ascii email subject and header encoding
- Next by thread: I got two different results in linux and windows, need help!
- Index(es):
Relevant Pages
|