Advertisement
Guest User

Untitled

a guest
Feb 24th, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <?php
  2. print "1";
  3. require("smtp.php");
  4. require("sasl.php"); //SASL authentication
  5. $from="support@yourwebsite.com";
  6. $smtp=new smtp_class;
  7. $smtp->host_name="smtp.gmail.com"; // Or IP address
  8. $smtp->host_port=465;
  9. $smtp->ssl=0;
  10. $smtp->start_tls=1;
  11. $smtp->localhost="localhost";
  12. $smtp->direct_delivery=0;
  13. $smtp->timeout=10;
  14. $smtp->data_timeout=0;
  15. $smtp->debug=1;
  16. $smtp->html_debug=1;
  17. $smtp->pop3_auth_host="";
  18. $smtp->user="john@gmail.com"; // SMTP Username
  19. $smtp->realm="";
  20. $smtp->password="House22"; // SMTP Password
  21. $smtp->workstation="";
  22. $smtp->authentication_mechanism="";
  23. print "3";
  24. if($smtp->SendMessage(
  25. $from,
  26. array(
  27. $to
  28. ),
  29. array(
  30. "From: $from",
  31. "To: $to",
  32. "Subject: $subject",
  33. "Date: ".strftime("%a, %d %b %Y %H:%M:%S %Z")
  34. ),
  35. "$message"))
  36. {
  37. print "Message sent to $to OK.";
  38. }
  39. else
  40. print "Cound not seend the message to $to.nError: ".$smtp->error;
  41. print "4";
  42. ?>
  43.  
  44. ==============================
  45.  
  46. <?php
  47. $to="ralph@website.com";
  48. $fn="First Name";
  49. $ln="Last Name";
  50. $name=$fn.' '.$ln;
  51. $from="test@grove.net";
  52. $subject = "Welcome to Website";
  53. $message = "Dear $name,
  54. Your Welcome Message.
  55. Thanks
  56. www.website.com
  57. ";
  58. include('smtpwork.php');
  59. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement