Второй день, не могу понять, что не так с кодом. Проблема отображения письма, отправленного с сайта есть, как в Яндексе, так и в мэил.ру, только по разному отображается. Вот код обработчика:
<?php
header('Content-type: text/plain; charset=UTF-8');
$mail = "direct-free@yandex.ru";
$subject = iconv('UTF-8', 'cp1251', "Моба: письмо отправленное с сайта");
$header = "Content-type: text/plain; charset=\"UTF-8\"";
$header .= "From: " . $mail;
$header .= "Subject: " . $subject;
$header .= "Content-type: text/plain; charset=\"UTF-8\"";
$message =
iconv('UTF-8', 'cp1251', "Имя: ") . $_REQUEST['Name'] .
iconv('UTF-8', 'cp1251', "\nПочта: ") . $_REQUEST['Email'] .
iconv('UTF-8', 'cp1251', "\nТелефон: ") . $_REQUEST['Phone'] .
iconv('UTF-8', 'cp1251', "\nТема: ") . $_REQUEST['Subject'] .
iconv('UTF-8', 'cp1251', "\nСообщение: ") . $_REQUEST['Message'];
$result = mail($mail, $subject, $message, $header);
echo "<!DOCTYPE html>";
echo "<html><head>";
echo '<meta http-equiv="Content-Type" content="text/html; charset=\"UTF-8\">';
echo "<title>Моба</title>";
echo "</head>";
echo "<body>";
echo $result ? "Ваше сообщение отправлено." : "При отправке заказа возникла ошибка. Пожалуйста, попробуйте позже.";
echo "</body>";
echo "</html>";
?>
Вот код формы:
<form role="form" method="post" id="contact-form">
<input type="text" placeholder="Ваше имя" name="Name" id="Name" required>
<input type="email" placeholder="Email" name="Email" id="Email" required>
<input type="text" placeholder="Номер телефона" name="Phone" id="Phone">
<input type="text" placeholder="Тема сообщения" name="Subject" id="Subject">
<textarea placeholder="Сообщение" name="Message" id="Message" required></textarea>
<button type="submit" id="submit">Отправить</button>
<div id="success"></div>
</form>