<?php
if($_POST['submit']) {
$phone = substr(htmlspecialchars(trim($_POST['phone'])), 0, 1000);
$name = substr(htmlspecialchars(trim($_POST['name'])), 0, 1000);
$message = "Телефон: ".$phone."
ФИО:".$name;
mail('mail@gmail.com', 'Новый заказ!', $message);
}
?>
$headers= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
mail($to, $subject, $message, $headers);
$from = "Webseite <website@domen.com>";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "From: $from\r\nReplay-To: $from\r\nContent-type: text/html; charset=ISO-8859-1\r\n";
$mes = '<html><body>';
$mes .= "
<p><b>Vorname:</b> ".$_POST['name']."</p>
<p><b>Nachname:</b> ".$_POST['lastname']."</p>
<p><b>E-mail:</b> ".$_POST['email']."</p>
<p><b>Nummer:</b> ".$_POST['phone']."</p>
<p><b>Brieftext:</b> ".$_POST['body']."</p>";
$mes .= '</body></html>';
$send = mail ($to, $subject, $mes, $headers);