Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once ('./lib/phpmailer2/class.phpmailer.php');
- if (isset($_POST['ok']))
- {
- //если существует переменная, значит начнем получать информацию из формы
- $fio=$_POST['fio'];
- $tel=$_POST['tel'];
- $text=$_POST['text'];
- }
- //mail('maksim.bizinkin.82z@mail.ru', 'Content-type:text/plain; charset=utf-8', 'сообщение с сайта', $text."\n".$fio."\n".$tel);
- $mailer = new PHPMailer();
- $mailer->IsSMTP();
- $mailer->CharSet = 'UTF-8';
- $mailer->Mailer = "smtp";
- $mailer->addCustomHeader("Precedence: bulk");
- $mailer->Host = "smtp.yandex.ru";
- $mailer->SMTPDebug = "1";
- $mailer->SMTPAuth = "true";
- $mailer->Port = "25";
- $mailer->Username = "coolpage5@yandex.ru";
- $mailer->Password = "мой пароль";
- $mailer->From = 'coolpage5@yandex.ru';
- $mailer->FromName = 'coolpage5@yandex.ru';
- $mailer->Subject = 'сообщение с сайта';
- $mailer->AddAddress('maksim.bizinkin.82z@mail.ru');
- $mailer->AddAddress('daemon@email.ua');
- $mailer->IsHTML(true);
- $mailer->Body = $text."\n".$fio."\n".$tel;
- @$mailer->Send();
- ?>
- <form method="post" action="sendmail.php">
- ФИО: <input name="fio" type="text" />
- <br />
- Телефон: <input name="tel" type="text" />
- <br />
- <textarea name="text">Введите текст</textarea>
- <br />
- <input type="submit" name="ok" value="Отправить" />
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement