Guest User

Untitled

a guest
Nov 21st, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <?php
  2.  
  3. require_once "Mail.php";
  4.  
  5. $htmlcontent = "Hi, How are you?";
  6.  
  7. $host = "smtp.indianvisaservice.org.in";
  8. $port = "587";
  9. $username = "support@indianvisaservice.org.in";
  10. $password = "somepassword";
  11. $replyto = "support@indianvisaservice.org";
  12.  
  13. $to = "imthegrv@gmail.com";
  14. $subject = "Complete Your e-Visa Application-".$appid."";
  15.  
  16. $from = "support@indianvisaservice.org.in";
  17. $headers = array ('From' => $from,
  18. 'To' => $to,
  19. 'Reply-To' => $replyto,
  20. 'Subject' => $subject,
  21. 'MIME-Version' => '1.0',
  22. 'Content-Type' => "text/html; charset=ISO-8859-1");
  23.  
  24. $smtp = Mail::factory('smtp',
  25. array ('host' => $host,
  26. 'port' => $port,
  27. 'auth' => true,
  28. 'socket_options' => array('ssl' => array('verify_peer_name' => false)),
  29. 'username' => $username,
  30. 'password' => $password));
  31.  
  32. $recipients = $to;
  33.  
  34. $mail = $smtp->send($recipients, $headers, $htmlContent);
  35.  
  36. if (PEAR::isError($mail)) {
  37. echo("<p>" . $mail->getMessage() . "</p>");
  38. } else {
  39. echo "Sent Successfully.";
  40. }
  41.  
  42. ?>
Add Comment
Please, Sign In to add comment