header('Content-Type: text/html; charset=utf-8');
if(isset($_GET['subject'])){$subject = $_GET['subject']; if($subject == ''){unset($subject);} }
if(isset($_GET['name'])){$name = $_GET['name']; if($name == ''){unset($name);} }
if(isset($_GET['email'])){$email = $_GET['email']; if($email == ''){unset($email);} }
if(isset($_GET['comment'])){$comment = $_GET['comment']; if($comment == ''){unset($comment);} }
if(isset($subject) && isset($name) && isset($email) && isset($comment)){
$recipient = 'Почта';
$subject = trim(addSlashes($subject));
$name = ucwords(trim(addSlashes($name)));
$email = trim(addSlashes($email));
$comment = trim($comment);
$body = "Контактное лицо: ".$name."\r\n"."Email: ".$email."\r\n"."Текст сообщения:\r\n".$comment;
$formsent = mail($recipient,$subject,$body);
if($formsent){
$data = $name." благодарим за ваше сообщение!";
}else{$data = "Ошибка1!";}
echo iconv ("UTF-8", "UTF-8", $data);
}else{echo iconv ("UTF-8", "UTF-8", "Ошибка!");}
Пхп код.