Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $email = $_POST['email'];
- if (empty($email)) {
- header('Location: /');
- exit(0);
- }
- require_once "Mail.php";
- $from = "<no-reply@sr76.ru>";
- $to = "<karina@sr76.ru>";
- $subject = "Подписка";
- $body = "Заинетерсовался новый email - $email";
- $host = "mail.sr76.ru";
- $username = "no-reply@sr76.ru";
- $password = "PASSWORD";
- $headers = array ('From' => $from,
- 'To' => $to,
- 'Subject' => $subject);
- $smtp = Mail::factory('smtp',
- array ('host' => $host,
- 'auth' => true,
- 'username' => $username,
- 'password' => $password));
- $mail = $smtp->send($to, $headers, $body);
- if (PEAR::isError($mail)) {
- echo("<p>" . $mail->getMessage() . "</p>");
- } else {
- echo("<p>Message successfully sent!</p>");
- header('Location: /');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement