Guest User

Untitled

a guest
Sep 3rd, 2018
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <?
  2. function mailResult ($to, $from, $subject, $text)
  3. {
  4. $message = "
  5. <html>
  6. <head>
  7. <title>{$subject}</title>
  8. </head>
  9. <body>
  10. {$text}
  11. </body>
  12. </html>
  13. ";
  14.  
  15. $headers = "MIME-Version: 1.0" . "\r\n";
  16. $headers .= "Content-type: text/html; charset=UTF-8" . "\r\n";
  17. $headers .= "To: admin <{$to}>" . "\r\n";
  18. $headers .= "From: server <{$from}>" . "\r\n";
  19.  
  20. $send = mail($to, $subject, $message, $headers);
  21.  
  22. if ($send)
  23. {
  24. return true;
  25. }
  26. else
  27. {
  28. return false;
  29. }
  30. }
  31.  
  32. //mailResult("кому", "от кого", "тема", "текст письма");
  33. mailResult($_POST['email'],"happyserge1991@mail.ru",'Результат пройденного вами, '.$_POST['fio'].', теста','Ваша оценка: '.$mark.' баллов');
  34. mailResult("happyserge1991@mail.ru","happyserge1991@mail.ru",''.$_POST['fio'].' - оценка '.$mark.' баллов');
  35. ?>
Add Comment
Please, Sign In to add comment