Russian characters in mail()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Victor

    #1

    Russian characters in mail()

    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,$subje ct,$content,$he ader). The header looks like
    this now : "From: xyz@abcdef.com\r\nX-Mailer:
    PHP/".phpversion(). "\r\nConten t-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

  • Manuel Lemos

    #2
    Re: Russian characters in mail()

    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,$subje ct,$content,$he ader). The header looks like
    this now : "From: xyz@abcdef.com\r\nX-Mailer:
    PHP/".phpversion(). "\r\nConten t-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_mess age.php example for a pratical example.

    http://www.phpclasses.org/mimemessage


    --

    Regards,
    Manuel Lemos

    Metastorage - Data object relational mapping layer generator


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

    Comment

    • Victor

      #3
      Re: Russian characters in mail()

      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

      Comment

      Working...