Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. $from="examplewebsite.com";
  2.  
  3. $to = "example@gmail.com";
  4. $subject = "Hi!";
  5. $body = "Hi,nnHow are you?";
  6.  
  7. $host = "https://website.com ";
  8. $username = "info@website.com";
  9. $port = "465";
  10. $password = "password";
  11.  
  12. $headers = array ('From' => $from,
  13. 'To' => $to,
  14. 'Subject' => $subject);
  15.  
  16. $smtp = Mail::factory('smtp',
  17. array ('host' => $host,
  18.  
  19. 'port' => $port,
  20. 'auth' => true,
  21. 'username' => $username,
  22. 'password' => $password));
  23.  
  24. $mail = $smtp->send($to, $headers, $body);
  25.  
  26. if (PEAR::isError($mail)) {
  27.  
  28. echo("
  29. " . $mail->getMessage() . "
  30.  
  31. "); } else { echo("
  32. Message successfully sent!
  33.  
  34. "); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement