Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'PHPMailerAutoload.php';
- require 'credential.php';
- $mail = new PHPMailer;
- $mail->SMTPDebug = 4; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp1.gmail.com;'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = EMAIL; // SMTP username
- $mail->Password = PASS; // SMTP password
- $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 587; // TCP port to connect to
- $mail->setFrom(EMAIL, 'Testing this');
- $mail->addAddress('testemail123@outlook.com'); // Add a recipient // Name is optional
- $mail->addReplyTo(EMAIL);
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Here is the subject';
- $mail->Body = 'This is the HTML message body <b>in bold!</b>';
- $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
- if(!$mail->send()) {
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- } else {
- echo 'Message has been sent';
- }
- ?>
- 2018-02-23 04:50:28 Connection: opening to smtp1.gmail.com:587, timeout=300, options=array ()
- 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]
- 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]
- 2018-02-23 04:50:28 SMTP ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: No such host is known. (0)
- 2018-02-23 04:50:28 Connection: opening to :587, timeout=300, options=array ()
- 2018-02-23 04:50:31 Connection: opened
- 2018-02-23 04:50:31 SMTP -> get_lines(): $data is ""
- 2018-02-23 04:50:31 SMTP -> get_lines(): $str is "220 xxx ESMTP"
- 2018-02-23 04:50:31 SERVER -> CLIENT: 220 xxx ESMTP
- 2018-02-23 04:50:31 CLIENT -> SERVER: EHLO localhost
- 2018-02-23 04:50:31 SMTP -> get_lines(): $data is ""
- 2018-02-23 04:50:31 SMTP -> get_lines(): $str is "250-xxx"
- 2018-02-23 04:50:31 SMTP -> get_lines(): $data is "250-xxx"
- 2018-02-23 04:50:31 SMTP -> get_lines(): $str is "250-SIZE 20480000"
- 2018-02-23 04:50:31 SMTP -> get_lines(): $data is "250-xxx250-SIZE 20480000"
- 2018-02-23 04:50:31 SMTP -> get_lines(): $str is "250-AUTH LOGIN"
- 2018-02-23 04:50:31 SMTP -> get_lines(): $data is "250-xxx250-SIZE 20480000250-AUTH LOGIN"
- 2018-02-23 04:50:31 SMTP -> get_lines(): $str is "250 HELP"
- 2018-02-23 04:50:31 SERVER -> CLIENT: 250-xxx250-SIZE 20480000250-AUTH LOGIN250 HELP
- 2018-02-23 04:50:31 CLIENT -> SERVER: STARTTLS
- 2018-02-23 04:50:31 SMTP -> get_lines(): $data is ""
- 2018-02-23 04:50:31 SMTP -> get_lines(): $str is "503 Bad sequence of commands"
- 2018-02-23 04:50:31 SERVER -> CLIENT: 503 Bad sequence of commands
- 2018-02-23 04:50:31 SMTP ERROR: STARTTLS command failed: 503 Bad sequence of commands
- SMTP Error: Could not connect to SMTP host.
- 2018-02-23 04:50:31 CLIENT -> SERVER: QUIT
- 2018-02-23 04:50:31 SMTP -> get_lines(): $data is ""
- 2018-02-23 04:50:31 SMTP -> get_lines(): $str is "221 goodbye"
- 2018-02-23 04:50:31 SERVER -> CLIENT: 221 goodbye
- 2018-02-23 04:50:31 Connection: closed
- SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
- 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