Advertisement
cocaineee

example4

Jan 24th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. <?php
  2.  
  3. if($_POST['submit']) {
  4.         $title = 'Письмо с сайта test.ru';
  5.         $mess =  substr(htmlspecialchars(trim($_POST['mess'])), 0, 1000000);
  6.         $tel =  substr(htmlspecialchars(trim($_POST['phone'])), 0, 1000000);
  7.         $name =  substr(htmlspecialchars(trim($_POST['name'])), 0, 1000000);
  8.  
  9.         $message = '
  10.        Имя отправителя: '.$name.'
  11.        Контактный телефон: '.$tel.'
  12.        '.$_POST['mess'];
  13.  
  14.         // $to - кому
  15.         $to = 'test@test.ru';
  16.         // $from - от кого
  17.         $from='test@test.ru';
  18.         // функция MAIL
  19.         mail($to, $title, $message, 'From:'.$from);
  20.         echo 'Спасибо! Ваше письмо отправлено.';
  21. }
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement