0

I have a webpage with a form for Russian people but, for example, if I insert this Cyrillic string:

Данные для трансфера

into one field and send the message, when I receive the email I have this string instead

Äàííûå äëÿ òðàíñôåðà.

This is the header that i use:

$headers .= "MIME-Version: 1.0"."\r\n" ."Content-type: text/plain; charset='utf-8'". "\r\n";
MasterAM
  • 16,283
  • 6
  • 45
  • 66
delizard
  • 7
  • 1
  • 7

1 Answers1

0

this example perfectly works for me:

$subject = 'Вопрос с сайта';
$subject = '=?windows-1251?B?'.base64_encode($subject).'?=';
$headers = "From: User <$email>\n";
$headers.= "Content-type: text/html; charset=\"windows-1251\"";
mail($my_email, $subject, $mail_body, $headers);

its not so much different from yours, but it works quite good. give it a try and tell us what you get. if it isn't working, the problem might be somewhere else. Check if the data you get for the e-mail is in the right encoding

Sam Braslavskiy
  • 1,268
  • 10
  • 19
  • Hi, thanks for your code but it doesn't work... :( (my server is in italy; your servr? ... it is possible that depend on this?) – delizard Oct 04 '13 at 16:13
  • my serv is in russia, but i don't think it makes a big difference. could you provide some more info concerning this issue? Is the russian text in subject or in body of the e-mail? are you fetching it from db? if yes, try to hardcode something in russian in email instead... just to see if it looks right. Are you using an ordinary php mail function? – Sam Braslavskiy Oct 04 '13 at 17:18