The second day, I can not understand what is wrong with the code. The problem of displaying a letter sent from the site is, both in Yandex and in mail.ru, only displayed in different ways. Here is the handler code:
<?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>"; ?> Here is the form code:
<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> 
