Advertisement
Guest User

Untitled

a guest
Jan 8th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. <?php
  2.  
  3. require_once("mailer/class.phpmailer.php");
  4. require_once("mailer/class.smtp.php");
  5.  
  6. $mail = new PHPMailer();
  7. $mail->IsSMTP(); // telling the class to use SMTP
  8.  
  9. $mail->SMTPSecure = false;
  10. $mail->Host = "mail.xxx.cz";
  11. $mail->SMTPAuth = true;
  12. $mail->SMTPKeepAlive = true;
  13. $mail->Port = 587;
  14. $mail->Username = "michal@mail.xxx.cz";
  15. $mail->Password = "TEST";
  16. $mail->SMTPDebug = 3;
  17.  
  18. $mail->FromName = "Michal";
  19. $mail->From = "michal@mail.xxx.cz";
  20. $mail->Subject = "Newsletter";
  21.  
  22. $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
  23. $mail->MsgHTML("testing");
  24. $mail->AddAddress("filfareu@gmail.com");
  25.  
  26. if(!$mail->Send()) {
  27. echo $mail->ErrorInfo;
  28. exit;
  29. }
  30. echo "Message has been sent";
  31.  
  32. ?>
  33.  
  34. 2016-01-08 12:03:35 Connection: opening to mail.xxx.cz:587, timeout=300, options=array (
  35. )
  36. 2016-01-08 12:03:35 Connection: opened
  37. 2016-01-08 12:03:35 SERVER -> CLIENT: 220 vm1xxxx ESMTP Postfix (Ubuntu)
  38. 2016-01-08 12:03:35 CLIENT -> SERVER: EHLO blog.xxx.cz
  39. 2016-01-08 12:03:35 SERVER -> CLIENT: 250-vm1xxxx
  40. 250-PIPELINING
  41. 250-SIZE 10240000
  42. 250-VRFY
  43. 250-ETRN
  44. 250-ENHANCEDSTATUSCODES
  45. 250-8BITMIME
  46. 250 DSN
  47. 2016-01-08 12:03:35 SMTP Error: Could not authenticate.
  48. 2016-01-08 12:03:35 CLIENT -> SERVER: QUIT
  49. 2016-01-08 12:03:35 SERVER -> CLIENT: 221 2.0.0 Bye
  50. 2016-01-08 12:03:35 Connection: closed
  51. 2016-01-08 12:03:35 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
  52. SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement