Sending Emails via PEAR::Mail - Russian chars in subject line

Discussion in 'PHP' started by Cobnut, Sep 23, 2009.

  1. #1
    We're running an email application that operates in multiple languages. So far all has gone well but we've just taken on a Russian customer and we've found that email subject lines are coming through blank.

    The same code is used for all languages and the entire site & db uses UTF-8 all the way. German, Italian, Polish, etc. all work, it appears to be only Russian.

    At present we're setting the 'head_charset' parameter to be 'UTF-8' - might the solution to be to use some form of Unicode for Russian?

    Any advice or recommendations welcomed.
     
    Cobnut, Sep 23, 2009 IP
  2. AsHinE

    AsHinE Well-Known Member

    Messages:
    240
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    138
    #2
    
    $subject = "Заголовок с русскими буквами - subject with russian letters";
    $subject = '=?utf-8?B?'.base64_encode($subject).'?=';
    
    PHP:
    then use $subject in mail() funtion

    I don't know where you do set this param, but I use code above to send mail with russian subject.
     
    AsHinE, Oct 2, 2009 IP