Guest User

Untitled

a guest
Dec 6th, 2017
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 KB | None | 0 0
  1. 2017-12-05 13:00:26 Connection: opening to smtp.gmail.com:587, timeout=300, options=array ( 'ssl' => array ( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, ),)
  2. 2017-12-05 13:00:26 Connection: opened
  3. 2017-12-05 13:00:26 SMTP INBOUND: "220 smtp.gmail.com ESMTP f3sm245851pgt.15 - gsmtp"
  4. 2017-12-05 13:00:26 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP f3sm245851pgt.15 - gsmtp
  5. 2017-12-05 13:00:26 CLIENT -> SERVER: EHLO localhost
  6. 2017-12-05 13:00:27 SMTP INBOUND: "250-smtp.gmail.com at your service, [110.36.136.72]"
  7. 2017-12-05 13:00:27 SMTP INBOUND: "250-SIZE 35882577"
  8. 2017-12-05 13:00:27 SMTP INBOUND: "250-8BITMIME"
  9. 2017-12-05 13:00:27 SMTP INBOUND: "250-STARTTLS"
  10. 2017-12-05 13:00:27 SMTP INBOUND: "250-ENHANCEDSTATUSCODES"
  11. 2017-12-05 13:00:27 SMTP INBOUND: "250-PIPELINING"
  12. 2017-12-05 13:00:27 SMTP INBOUND: "250-CHUNKING"
  13. 2017-12-05 13:00:27 SMTP INBOUND: "250 SMTPUTF8"
  14. 2017-12-05 13:00:27 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [110.36.136.72]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
  15. 2017-12-05 13:00:27 CLIENT -> SERVER: STARTTLS
  16. 2017-12-05 13:00:27 SMTP INBOUND: ""
  17. 2017-12-05 13:00:27 SERVER -> CLIENT:
  18. 2017-12-05 13:00:27 SMTP ERROR: STARTTLS command failed:
  19. SMTP Error: Could not connect to SMTP host.
  20. 2017-12-05 13:00:27 SMTP NOTICE: EOF caught while checking if connected
  21. 2017-12-05 13:00:27 Connection: closed
  22. SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
  23. Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
  24.  
  25. use PHPMailerPHPMailerPHPMailer;
  26. use PHPMailerPHPMailerOAuth;
  27. use LeagueOAuth2ClientProviderGoogle;
  28.  
  29. require '../../vendor/autoload.php';
  30. $mail = new PHPMailer;
  31. $mail->isSMTP();
  32. $mail->SMTPDebug = 4;
  33.  
  34. $mail->Host = 'smtp.gmail.com';
  35. $mail->Port = 587;
  36.  
  37. $mail->SMTPSecure = 'tls';
  38. $mail->SMTPAuth = true;
  39. $mail->SMTPAutoTLS = false;
  40.  
  41. $mail->SMTPOptions = array(
  42. 'ssl' => array(
  43. 'verify_peer' => false,
  44. 'verify_peer_name' => false,
  45. 'allow_self_signed' => true
  46. )
  47. );
  48.  
  49. $mail->Username = $from_address;
  50. $mail->Password = $from_password;
  51. $mail->SetLanguage("tr", "phpmailer/language");
  52. $mail->CharSet = "utf-8";
  53. $mail->Encoding = "base64";
  54. $mail->SetFrom($from_address, $from_name);
  55.  
  56. foreach ($to_email_list as $to) {
  57. $mail->AddAddress($to);
  58. }
  59.  
  60. $mail->AddReplyTo($from_address, $from_name);
  61. $mail->Subject = $email_subject;
  62.  
  63. //Creating Email Body
  64. $message = "<html>n";
  65. $message .= "<body>n";
  66. $message .= '<p>Greetings,</p>';
  67. $message .= '<p>' . $email_message . '</p>';
  68. $message .= "</body>n";
  69. $message .= "</html>n";
  70. $mail->isHTML(true);
  71. $mail->MsgHTML($message);
  72.  
  73. if(!$mail->Send()) {
  74. echo "On Port: " . $from_smtp_port . " </br> Mailer Error: " . $mail->ErrorInfo;
  75. } else {
  76. echo "Message sent! on Port " . $from_smtp_port . "</br>";
  77.  
  78. foreach($to_email_list as $list){
  79. echo $list . "</br>";
  80. }
  81.  
  82. }
Add Comment
Please, Sign In to add comment