When sending mail, I receive in the text of the letter: "the placement in the information system is a protocol ..." is similar, I structure the text into a letter using foreach .. that is, I take it from the array. Shipped as follows:
$message = "<html><body>"; $message .= "<h3 style='text-align:center'>Поздравляем bla .</h3>"; $message .= "<h2 style='text-align:center;'>Ответы</h2>"; foreach ($err_array as $err => $el) { foreach ($el as $item => $val) { $message .= '<h4>Вопрос №'. $err .'</h4>'; $val = htmlentities($errors_to_send[$err]['otvet']); $message .= '<h4>'.$my_questions[$err]['quest']. '</h4>'; $message .= '<p>Правильный ответ:'. htmlentities($my_questions[$err]['answers'][--$val]) .'</p>'; $message .= '<h5>Комментарий :</h5><p>' . htmlentities($errors_to_send[$err]['comment']) .'</p><hr>'; } } $messahe .= "</body></html>" $subject = 'Ответы на тест.'; $headers = "From: admin@bla-bla.ru\r\n"; $headers .= "Reply-To: admin@bla-bla.ru\r\n"; $headers .= "CC: admin@bla-bla.ru\r\n"; $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; $headers .= "MIME-Version: 1.0\r\n"; //ISO-8859-1 попробуем явно указать utf-8 //$headers .= "Content-Type: text/html; charset=utf-8\r\n"; if(mail($_POST["mail"],$subject, $message, $headers)){ echo "<p>Письмо отправлено на почту </p>".$_POST["mail"]; }else echo "<p>mail to ".$_POST["mail"]." return false.";