Last active
April 6, 2022 04:32
-
-
Save aislam23/813cb244212f8ce19bb742eb7ceb8d26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Принимаем постовые данные | |
$name=$_POST['name']; | |
$phone=$_POST['phone']; | |
//Тут указываем на какой ящик посылать письмо | |
$to = "79991570874@yandex.ru"; | |
//Далее идет тема и само сообщение | |
// Тема письма | |
$subject = "Заявка с сайта"; | |
// Сообщение письма | |
$message = " | |
Имя пользователя: ".htmlspecialchars($name)."<br /> | |
Телефон: <a href='tel:$phone'>".htmlspecialchars($phone)."</a>"; | |
// Отправляем письмо при помощи функции mail(); | |
$headers = "From: stastroi.ru <mail@stastroi.ru>\r\nContent-type: text/html; charset=UTF-8 \r\n"; | |
mail ($to, $subject, $message, $headers); | |
// Перенаправляем человека на страницу благодарности и завершаем скрипт | |
header('Location: thanks.html'); | |
exit(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you!