Skip to content

Instantly share code, notes, and snippets.

@Able1991
Created June 10, 2015 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Able1991/e349c770544bfaf3ee55 to your computer and use it in GitHub Desktop.
Save Able1991/e349c770544bfaf3ee55 to your computer and use it in GitHub Desktop.
<?php
if($_SERVER["REQUEST_METHOD"]=="POST") {
function send_mail($to,$subject,$message,$headers) {
$email=$_POST["email"]; //email с формы
$phone=$_POST["phone"]; //телефон с формы
$name=$_POST["name"];
$to="1unitedcrew@gmail.com";
$subject="Заявка";
$message="Имя: $name<br>Телефон: $phone<br>Email: $email"; //сообщение
$headers="Content-type: text/html; charset=utf-8 \r\n";
$from="=?UTF-8?B?".base64_encode("test")."?= <test@test.ru>";
$headers.="From: $from\r\n";
$headers.="Reply-To: $email\r\n";
$result=mail($to,$subject,$message,$headers);
return $result;
}
if (send_mail()) {
echo "Хорошо";
} else {
echo "Плохо";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment