Advertisement
Guest User

Untitled

a guest
May 30th, 2016
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php
  2. require("class.phpmailer.php"); // path to the PHPMailer class
  3.  
  4. $mail = new PHPMailer();
  5.  
  6. $mail->IsSMTP(); // telling the class to use SMTP
  7. $mail->Mailer = "smtp";
  8. $mail->Host = "smtp.gmail.com";
  9. $mail->Port = 465;
  10. $mail->SMTPSecure = 'ssl';
  11. $mail->SMTPAuth = true; // turn on SMTP authentication
  12. $mail->Username = "gmail"; // SMTP username
  13. $mail->Password = "pass"; // SMTP password
  14.  
  15. $mail->AddAddress("tareksabry333@outlook.com");
  16. $mail->From = "gmail";
  17. $mail->Subject = "PHP Mailer";
  18. $mail->Body = "Test";
  19. $mail->WordWrap = 50;
  20.  
  21. if(!$mail->Send()) {
  22. echo 'Message was not sent.';
  23. echo 'Mailer error: ' . $mail->ErrorInfo;
  24. } else {
  25. echo 'Message has been sent.';
  26. }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement