Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- function mailResult ($to, $from, $subject, $text)
- {
- $message = "
- <html>
- <head>
- <title>{$subject}</title>
- </head>
- <body>
- {$text}
- </body>
- </html>
- ";
- $headers = "MIME-Version: 1.0" . "\r\n";
- $headers .= "Content-type: text/html; charset=UTF-8" . "\r\n";
- $headers .= "To: admin <{$to}>" . "\r\n";
- $headers .= "From: server <{$from}>" . "\r\n";
- $send = mail($to, $subject, $message, $headers);
- if ($send)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- //mailResult("кому", "от кого", "тема", "текст письма");
- mailResult($_POST['email'],"happyserge1991@mail.ru",'Результат пройденного вами, '.$_POST['fio'].', теста','Ваша оценка: '.$mark.' баллов');
- mailResult("happyserge1991@mail.ru","happyserge1991@mail.ru",''.$_POST['fio'].' - оценка '.$mark.' баллов');
- ?>
Add Comment
Please, Sign In to add comment