Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <?php
  2. include('Mail.php');
  3. $from = "mail@domain.com";
  4. $to = "lerenarzp2@gmail.com";
  5. $subject = "SMTP Test";
  6. $body = "Testing SMTP() mail functionality";
  7. $date = date("D, d M Y H:i:s O");
  8. $host = "mail.domain.com";
  9. $username = "mail@domain.com";
  10. $password = "PASSWORD";
  11. $port = "587";
  12. $headers = array ('From' => $from,
  13. 'To' => $to,
  14. 'Subject' => $subject,
  15. 'Date' => $date);
  16. $smtp = Mail::factory('smtp',
  17. array ('host' => $host,
  18. 'port' => $port,
  19. 'auth' => true,
  20. 'username' => $username,
  21. 'password' => $password, 'localhost' => $host));
  22. $mail = $smtp->send($to, $headers, $body);
  23. if (PEAR::isError($mail)) {
  24. echo("<p>" . $mail->getMessage() . "</p>");
  25. } else {
  26. echo("<p>SMTP message successfully sent!</p>");
  27. }
  28. echo realpath('Mail.php');
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement