Guest User

Untitled

a guest
Feb 22nd, 2018
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 KB | None | 0 0
  1. <?php
  2. require 'PHPMailerAutoload.php';
  3. require 'credential.php';
  4.  
  5. $mail = new PHPMailer;
  6.  
  7. $mail->SMTPDebug = 4; // Enable verbose debug output
  8.  
  9. $mail->isSMTP(); // Set mailer to use SMTP
  10. $mail->Host = 'smtp1.gmail.com;'; // Specify main and backup SMTP servers
  11. $mail->SMTPAuth = true; // Enable SMTP authentication
  12. $mail->Username = EMAIL; // SMTP username
  13. $mail->Password = PASS; // SMTP password
  14. $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
  15. $mail->Port = 587; // TCP port to connect to
  16.  
  17. $mail->setFrom(EMAIL, 'Testing this');
  18. $mail->addAddress('testemail123@outlook.com'); // Add a recipient // Name is optional
  19. $mail->addReplyTo(EMAIL);
  20. $mail->isHTML(true); // Set email format to HTML
  21.  
  22. $mail->Subject = 'Here is the subject';
  23. $mail->Body = 'This is the HTML message body <b>in bold!</b>';
  24. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  25.  
  26. if(!$mail->send()) {
  27. echo 'Message could not be sent.';
  28. echo 'Mailer Error: ' . $mail->ErrorInfo;
  29. } else {
  30. echo 'Message has been sent';
  31. }
  32. ?>
  33.  
  34. 2018-02-23 04:50:28 Connection: opening to smtp1.gmail.com:587, timeout=300, options=array ()
  35. 2018-02-23 04:50:28 Connection failed. Error #2: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: No such host is known. [C:wamp64wwwmailerphpmailerclass.smtp.php line 299]
  36. 2018-02-23 04:50:28 Connection failed. Error #2: stream_socket_client(): unable to connect to smtp1.gmail.com:587 (php_network_getaddresses: getaddrinfo failed: No such host is known. ) [C:wamp64wwwmailerphpmailerclass.smtp.php line 299]
  37. 2018-02-23 04:50:28 SMTP ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: No such host is known. (0)
  38. 2018-02-23 04:50:28 Connection: opening to :587, timeout=300, options=array ()
  39. 2018-02-23 04:50:31 Connection: opened
  40. 2018-02-23 04:50:31 SMTP -> get_lines(): $data is ""
  41. 2018-02-23 04:50:31 SMTP -> get_lines(): $str is "220 xxx ESMTP"
  42. 2018-02-23 04:50:31 SERVER -> CLIENT: 220 xxx ESMTP
  43. 2018-02-23 04:50:31 CLIENT -> SERVER: EHLO localhost
  44. 2018-02-23 04:50:31 SMTP -> get_lines(): $data is ""
  45. 2018-02-23 04:50:31 SMTP -> get_lines(): $str is "250-xxx"
  46. 2018-02-23 04:50:31 SMTP -> get_lines(): $data is "250-xxx"
  47. 2018-02-23 04:50:31 SMTP -> get_lines(): $str is "250-SIZE 20480000"
  48. 2018-02-23 04:50:31 SMTP -> get_lines(): $data is "250-xxx250-SIZE 20480000"
  49. 2018-02-23 04:50:31 SMTP -> get_lines(): $str is "250-AUTH LOGIN"
  50. 2018-02-23 04:50:31 SMTP -> get_lines(): $data is "250-xxx250-SIZE 20480000250-AUTH LOGIN"
  51. 2018-02-23 04:50:31 SMTP -> get_lines(): $str is "250 HELP"
  52. 2018-02-23 04:50:31 SERVER -> CLIENT: 250-xxx250-SIZE 20480000250-AUTH LOGIN250 HELP
  53. 2018-02-23 04:50:31 CLIENT -> SERVER: STARTTLS
  54. 2018-02-23 04:50:31 SMTP -> get_lines(): $data is ""
  55. 2018-02-23 04:50:31 SMTP -> get_lines(): $str is "503 Bad sequence of commands"
  56. 2018-02-23 04:50:31 SERVER -> CLIENT: 503 Bad sequence of commands
  57. 2018-02-23 04:50:31 SMTP ERROR: STARTTLS command failed: 503 Bad sequence of commands
  58. SMTP Error: Could not connect to SMTP host.
  59. 2018-02-23 04:50:31 CLIENT -> SERVER: QUIT
  60. 2018-02-23 04:50:31 SMTP -> get_lines(): $data is ""
  61. 2018-02-23 04:50:31 SMTP -> get_lines(): $str is "221 goodbye"
  62. 2018-02-23 04:50:31 SERVER -> CLIENT: 221 goodbye
  63. 2018-02-23 04:50:31 Connection: closed
  64. SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
  65. Message could not be sent.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Add Comment
Please, Sign In to add comment