Guest User

Untitled

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