Guest User

Untitled

a guest
Jun 29th, 2018
481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. $mail = new PHPMailer;
  2. $mail->isSMTP();
  3. $mail->SMTPDebug = 2;
  4. $mail->Host = 'smtp.gmail.com';
  5. $mail->Port = 587;
  6. $mail->SMTPSecure = 'tls';
  7. $mail->SMTPAuth = true;
  8. $mail->Username = "xx@gmail.com";
  9. $mail->Password = "xx";
  10. $mail->setFrom('xx@gmail.com', 'First Last');
  11. $mail->addAddress('xx@xx.com.br', 'John Doe');
  12. $mail->Subject = 'PHPMailer GMail SMTP test';
  13. $mail->Body = 'This is a plain-text message body';
  14. if (!$mail->send()) {
  15. echo "Mailer Error: " . $mail->ErrorInfo;
  16. } else {
  17. echo "Message sent!";
  18. }
  19.  
  20. 2018-06-29 20:15:09 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP d18-v6sm6204628qtl.32 - gsmtp
  21. 2018-06-29 20:15:09 CLIENT -> SERVER: EHLO localhost
  22. 2018-06-29 20:15:09 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [189.120.238.241]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250 SMTPUTF8
  23. 2018-06-29 20:15:09 CLIENT -> SERVER: STARTTLS
  24. 2018-06-29 20:15:09 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
  25. SMTP Error: Could not connect to SMTP host.
  26. 2018-06-29 20:15:10 CLIENT -> SERVER: QUIT
  27. 2018-06-29 20:15:10 SERVER -> CLIENT:
  28. 2018-06-29 20:15:10 SMTP ERROR: QUIT command failed:
  29. SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
  30. Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Add Comment
Please, Sign In to add comment