Skip to content

Instantly share code, notes, and snippets.

@sharkyak
Last active January 26, 2017 10:51
Show Gist options
  • Save sharkyak/70f9e4b0d8d4273a9af2 to your computer and use it in GitHub Desktop.
Save sharkyak/70f9e4b0d8d4273a9af2 to your computer and use it in GitHub Desktop.
mail.php
<?php
$to = "[email protected]"; // адрес куда отправлять письмо
$subject = "Отправка формы с сайта агентства"; // заголовок письма
$redirect = "http://dev.ak-agency.ru/zhaluzi/thankyou.html"; // адрес страницы, на которую нужно перейти после отправки письма
foreach($_POST as $key => $value)
{ $fields .= $key.": ".$value." \r\n"; }
$message = $subject." \r\n".$fields;
$headers = "Content-type: text/plain; charset=utf-8 \r\n";
mail($to, $subject, $message, $headers);
header('Location: '.$redirect);
?>
@sharkyak
Copy link
Author

$_POST = json_decode(file_get_contents('php://input'), true);

axios fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment