Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $names = Array(
- "name" => "Имя",
- "email" => "Емаил",
- "phone" => "Телефон",
- "product_name" => "Продукт",
- );
- foreach ($_POST as $key => $value) {
- if (array_key_exists($key, $names)) {
- $n = $names[$key];
- $text .= "$n : $value \n";
- }
- }
- $to = "mail@mail.ru";
- $headers = "Content-type: text/plain; charset = utf-8";
- $subject = "письмо";
- $send = mail($to, $subject, $text, $headers);
- if ($send) {
- echo "success";
- }
Add Comment
Please, Sign In to add comment