Interested in the question: why when sending a form to the mail come data in an unformatted form (in one line) and how to fix it?
<?php // check if fields passed are empty if(empty($_POST['name']) || empty($_POST['message']) || empty($_POST['email'])) { echo "Не переданы данные!"; return false; } $name = $_POST['name']; $message = $_POST['message']; $email = $_POST['email']; // create email body and send it $to = 'aomeone@some.ru'; // put your email $email_subject = "Вопрос с сайта some.ru"; $email_body = "Заполнена форма \"Задать вопрос\" \n\r". "Данные отправителя\r\nИмя: $name\r\n". "Email: $email \r\n". "Вопрос: $message"; $headers = "Content-type: text/html; charset=utf-8 \r\n"; $headers .= "From: info@some.ru \r\n"; $headers .= "Reply-To: $email"; mail($to, '=?UTF-8?B?'.base64_encode($email_subject).'?=',$email_body,$headers); return true; ?> 