Guest User

Untitled

a guest
Dec 27th, 2017
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <?php
  2. try {
  3. require_once "Mail.php";
  4. require_once "Mail/mime.php";
  5. $from = "support@domain.com";
  6. $to = "user@gmail.com";
  7. $subject = "Testing email please ignore";
  8. $message = "Just testing";
  9. $host = "godaddyhost";
  10. $port = "465";
  11. $username = "support@domain.com";
  12. $password = "password";
  13. $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject);
  14. $smtp = Mail::factory('smtp', array ('host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password));
  15. $mail = $smtp->send($to, $headers, $message);
  16. if (PEAR::isError($mail)) {
  17. echo("<p>" . $mail->getMessage() . "</p>");
  18. } else {
  19. echo("<p>Message successfully sent!</p>");
  20. }
  21.  
  22. } catch(Exception $e) {
  23. echo $e;
  24. }
  25. ?>
  26.  
  27. This page isn’t working
  28. localhost is currently unable to handle this request.
  29. HTTP ERROR 500
Add Comment
Please, Sign In to add comment