Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2. require_once "Mail.php";
  3.  
  4. $from = "GE-Bot <notifications@ge-bot.com>";
  5. $to = "Timer <timer150@gmail.com>";
  6. $subject = "Grand Exchange Update Notification";
  7. $body = "The Grand Exchange updated at $updatetime. \n\nKind Regards,\nGE-Bot";
  8.  
  9. $host = "smtp.gmail.com";
  10. $username = "Timer150@gmail.com";
  11. $password = "";
  12.  
  13. $headers = array ('From' => $from,
  14. 'To' => $to,
  15. 'Subject' => $subject);
  16. $smtp = Mail::factory('smtp',
  17. array ('host' => $host,
  18. 'auth' => true,
  19. 'username' => $username,
  20. 'password' => $password));
  21.  
  22. $mail = $smtp->send($to, $headers, $body);
  23.  
  24. if (PEAR::isError($mail)) {
  25. echo("<p>" . $mail->getMessage() . "</p>");
  26. } else {
  27. echo("<p>Message successfully sent!</p>");
  28. }
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement