views:

82

answers:

2

Hello, I have some troubles with encoding and mailing. I send post-request to php-script, when I do

print_r( $_POST );

I could see my text normally, but when I'm trying to send it into email, using code:

$text = ...; // Includeing data from $_POST;
    $headers  = "From: test\r\n";
    $headers .= "Return-Path: test\r\n";
    $headers .= 'MIME-Version: 1.0' . "\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail( '[email protected]', 'Посылка от формы контактов', $text, $headers )

Yes, mail's theme is in cyryllical. So, when I get mail I see something like:

Здравствуйте!
На сайте была заполнена форма контактов:
Наименование организации: Наименование организации
Контактное лицо: Контактное лицо
Телефон: Телефон
E-mail: имейл
На тему: Замечания РїРѕ работе сайта
текст сообщения

But subject and another text, which I'm adding in send-script is readable.

What is my problem?

+2  A: 

The cyrillic alphabet is contained within the following charset:

charset=iso-8859-5

You could try and change your charset. I'm really up in the air on this one but I thought I'd try to help.

For a longer listing of charsets, visit here

cballou
When I applyed that encoding, I can't even seen that text I've posted in script.
Ockonal
I tried different encodings but It didn't help me :(
Ockonal
A: 

Make sure your file including the email's text is using the proper encoding.

chelmertz