Guest User

CODE

a guest
Jan 18th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <?php
  2.  
  3. error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT);
  4. ini_set("include_path", '/home2/siicserv/php:' . ini_get("include_path") );
  5.  
  6. require_once "Mail.php";
  7.  
  8. $host = "ssl://smtp.zoho.com";
  9. $username = "no-reply@srmiic.com";
  10. $password = "Killmedude@123";
  11. $port = "465";
  12. $to = "monuabhaysv@gmail.com";
  13. $email_from = "no-reply@srmiic.com";
  14. $email_subject = "Test email" ;
  15. $email_body = "email is for test" ;
  16. $email_address = "systems@srmiic.com";
  17.  
  18. $headers = array ('From' => $email_from, 'To' => $to, 'Subject' => $email_subject, 'Reply-To' => $email_address);
  19. $smtp = Mail::factory('smtp', array ('host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password));
  20. $mail = $smtp->send($to, $headers, $email_body);
  21.  
  22.  
  23. if (PEAR::isError($mail)) {
  24. echo("<p>" . $mail->getMessage() . "</p>");
  25. } else {
  26. echo("<p>Message successfully sent!</p>");
  27. }
  28. ?>
Add Comment
Please, Sign In to add comment