|
Posted by Manuel Lemos on 10/31/06 13:08
Hello,
on 10/31/2006 07:03 PM Victor said the following:
> could anybody kindly give me a hint for dealing with the following
> problem :
>
> I need to send e-mails from a PHP 5 script running on Windows Apache,
> containing Russian characters in the subject and in the content. I use
> the function mail($to,$subject,$content,$header). The header looks like
> this now : "From: xyz@abcdef.com\r\nX-Mailer:
> PHP/".phpversion()."\r\nContent-Type: text/plain; charset='utf-8'"
>
> Regrettably, the result is not much encouraging : I receive only
> unreproducable characters on the other (receiver) side...
The content type character set only applies to the body. Headers must
encoded individually with q-encoding.
You may want to take a look at this class that can encode headers and
bodies properly as needed. Just use the default_charset class variable
to utf-8 and the whole message will be encoded properly. Take a look at
the test_email_message.php example for a pratical example.
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/
Navigation:
[Reply to this message]
|