L
L
Legioner9112015-09-28 10:46:27
PHP
Legioner911, 2015-09-28 10:46:27

Why do gibberish messages come to The bat and Outlook, but normal to mail services?

<?
header('Content-Type: text/html; charset=utf-8');
$kuda = '[email protected]';
$zagolovok = 'Сообщение с сайта';
$headers = 'Content-type: text; charset="utf-8"';

if (isset($_POST['ok'])){
  $fio = $_POST['fio'];
  $email = $_POST['email'];
  $tel = $_POST['tel'];
  $text = $_POST['text'];

  $messages = "E-Mail: {$email}\n";
  $messages .= "Номер: {$tel}\n";
  $messages .= "ФИО: {$fio}\n\n";
  $messages .= "{$text}";

  if (mail($kuda, $zagolovok, $messages, $headers)) {
    echo 'Отправлено';
  }
}
?>

Looking ahead, I’ll say that the reconfiguration of the program does not work ...
Thank you in advance for the expert’s practical answer!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2015-09-28
@Legioner911

$zagolovok = '=?utf-8?B?'.base64_encode('Сообщение с сайта').'?=';
$headers = "Content-type: text/plain; charset=\"utf-8\"\r\n".
           "Content-transfer-encoding: 8bit";

S
Sergey Zelensky, 2015-09-28
@SergeyZelensky-Rostov

try to replace utf-8 with windows-1251 bkb cp1251 and send something changed?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question