Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define('EMAIL_TO', '[email protected]');
- define('EMAIL_SUBJECT', 'Обратная связь');
- $data = isset($_POST['d']) ? @json_decode($_POST['d'], true) : array();
- $headers = "";
- $headers .= "X-Priority: 3\r\n";
- $headers .= "MIME-Version: 1.0\r\n";
- $headers .= "Content-Type: text/plain; charset=\"" . "utf-8" . "\"\r\n";
- $headers .= "Content-Transfer-Encoding: 8bit\r\n";
- $body = "";
- if ($data) {
- foreach($data as $field) {
- $title = @strip_tags($field['title']);
- $value = @strip_tags($field['value']);
- $body .= sprintf("%s: %s\r\n", $title, $value);
- }
- $mail = @mail(EMAIL_TO, EMAIL_SUBJECT, $body, $headers);
- }
- if ($mail) {
- die(json_encode(array("success" => "Спасибо! Ваша заявка принята.")));
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment