Pobrałem skrypt z githuba i nie moge sobie poradzic z wysyłaniem.
Skrypt uruchamiam na xampp'ie.
Na Gmailu włączyłem dostęp dla mniej bezpiecznych aplikacji a ciągle nie moge wysyłac wiadomosci.
Na 100% dobrze wpisuje email i hasło wiec nie wiem gdzie moze lezec problem prosze o pomoc.
Ponizej zamieszczam "mój" skrypt oraz informacje z wyświetlane za pomoca debbugera.
<?php require '../mail/PHPMailerAutoload.php'; require("../mail/class.smtp.php"); $mail = new PHPMailer; //$mail->SMTPDebug = 3; // Enable verbose debug output $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'mojemail@gmail.com'; // SMTP username $mail->Password = 'mojehasłogmail'; // SMTP password $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted $mail->Port = 587; // TCP port to connect to $mail->setFrom('uwolnic_orke@onet.pl', 'Mailer'); $mail->addAddress('uwolnic_orke@onet.pl', 'Joe User'); // Add a recipient //$mail->addAddress('uwolnic_orke@onet.pl'); // Name is optional $mail->addReplyTo('info@example.com', 'Information'); $mail->addCC('cc@example.com'); //$mail->addBCC('bcc@example.com'); //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name $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()) { } else { }
https://support.google.com/mail/?p=WantAuthError f134sm8875548wmf.19 - gsmtp 2016-12-14 18:56:19 SMTP ERROR: STARTTLS command failed: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 https://support.google.com/mail/?p=WantAuthError f134sm8875548wmf.19 - gsmtp 2016-12-14 18:56:19 SMTP Error: Could not connect to SMTP host. 2016-12-14 18:56:19 CLIENT -> SERVER: QUIT 2016-12-14 18:56:19 SERVER -> CLIENT: 221 2.0.0 closing connection f134sm8875548wmf.19 - gsmtp 2016-12-14 18:56:19 Connection: closed 2016-12-14 18:56:19 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">2016-12-14 18:56:19 Connection: opening to ssl://smtp.gmail.com:465, timeout=300, options=array ( ) 2016-12-14 18:56:19 Connection: opened 2016-12-14 18:56:19 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP f134sm8875548wmf.19 - gsmtp 2016-12-14 18:56:19 CLIENT -> SERVER: EHLO localhost 2016-12-14 18:56:19 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [83.26.232.44] 250-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8 2016-12-14 18:56:19 CLIENT -> SERVER: STARTTLS 2016-12-14 18:56:19 SERVER -> CLIENT: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 https://support.google.com/mail/?p=WantAuthError f134sm8875548wmf.19 - gsmtp 2016-12-14 18:56:19 SMTP ERROR: STARTTLS command failed: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 https://support.google.com/mail/?p=WantAuthError f134sm8875548wmf.19 - gsmtp 2016-12-14 18:56:19 SMTP Error: Could not connect to SMTP host. 2016-12-14 18:56:19 CLIENT -> SERVER: QUIT 2016-12-14 18:56:19 SERVER -> CLIENT: 221 2.0.0 closing connection f134sm8875548wmf.19 - gsmtp 2016-12-14 18:56:19 Connection: closed 2016-12-14 18:56:19 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