By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,841 Members | 840 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,841 IT Pros & Developers. It's quick & easy.

Russian characters in mail()

P: n/a
Hi everybody,

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: xy*@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...

How to tackle this?

Thanks in advance

Victor

Oct 31 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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: xy*@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/
Oct 31 '06 #2

P: n/a
Hi Manuel,

thank you very much for your encoding class. It works apparently great.
Unfortunately, the mails produced by it, do not get delivered by my
email provider.
You know, the mails generated with my code do get, and the mails
generated with your class do not. Though, the function
$email_message->Send() does not report any errors.

Could you suggest an idea about what may cause this?

Victor

Oct 31 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.