Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ALL);
  3. require('PHPMailer_5.2.4/class.phpmailer.php');
  4. $mail = new PHPMailer();
  5. $mail->IsSMTP(); // set mailer to use SMTP
  6. $mail->SMTPDebug = 2;
  7. $mail->From = "xxx@xxxxxx.ca";
  8. $mail->FromName = "xx";
  9. $mail->Host = "smtp.gmail.com"; // specif smtp server
  10. $mail->SMTPSecure= "ssl"; // Used instead of TLS when only POP mail is selected
  11. $mail->Port = 465; // Used instead of 587 when only POP mail is selected
  12. $mail->SMTPAuth = true;
  13. $mail->Username = "xxx@xxxxxx.ca"; // SMTP username
  14. $mail->Password = "xxxxxxx"; // SMTP password
  15. $mail->AddAddress("xxxx@xxxxxxx.com", "xxx"); //replace myname and mypassword to yours
  16. $mail->AddReplyTo("info@xxxxxxxxx.ca", "xxx");
  17. $mail->WordWrap = 50; // set word wrap
  18. //$mail->AddAttachment("c:\temp\js-bak.sql"); // add attachments
  19. //$mail->AddAttachment("c:/temp/11-10-00.zip");
  20.  
  21. //$mail->IsHTML(true); // set email format to HTML
  22. $mail->Subject = 'test';
  23. $mail->Body = 'test';
  24.  
  25. if($mail->Send()) {echo "Send mail successfully!!!";}
  26. else {echo "Send mail fail";}
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement