인증 오류가 발생하여 문제가 어디에 있는지 알고 싶습니다.
include_once('phpmailer/class.phpmailer.php'); include_once('phpmailer/class.smtp.php'); //6nb5Drv; function sendmail(){ $mail = new PHPMailer(); $mail->IsSMTP(); // set mailer to use SMTP $mail->SMTPAuth = true; // turn on SMTP authentication $mail->SMTPSecure = "tls"; $mail->Host = "smtp.gmail.com"; // specify main and backup server $mail->Port = 587; // Set the SMTP port i tried and 457 $mail->Username = '[email protected]'; // SMTP username $mail->Password = 'newmailpass'; // SMTP password $mail->SMTPDebug = 1; // enables SMTP debug information (for testing) // 1 = errors and messages // 2 = messages only $mail->From = '[email protected]'; $mail->FromName = 'From'; $mail->AddAddress('[email protected]', 'To'); // Add a recipient $mail->IsHTML(true); // Set email format to HTML $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body <strong>in bold!</strong>'; $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; exit; } echo 'Message has been sent'; } sendmail();
하지만 인증 오류가 발생합니다. 뭐가 잘못 되었 니? 아마도 자격 증명이있는 것 같습니다 .Gmail smtp를 어떻게 구성합니까?
디버그 보고서 :
2015-12-04 17:56:15 CLIENT-> SERVER : EHLO www.site.co 2015-12-04 17:56:15 CLIENT-> SERVER : STARTTLS 2015-12-04 17:56:15 CLIENT-> 서버 : EHLO www.site.co 2015-12-04 17:56:15 CLIENT-> SERVER : AUTH LOGIN 2015-12-04 17:56:15 CLIENT-> SERVER : UHJlZGljdG9sb2d5 2015-12-04 17:56 : 15 CLIENT-> SERVER : U2dHZlB0VHZUbTZ1SW9ZMi1qTlNCQQ == 2015-12-04 17:56:17 SMTP 오류 : 암호 명령 실패 : 435 4.7.8 오류 : 인증 실패 : UGFzc3dvcmQ6 2015-12-04 17:56:17 SMTP 오류 : 가능 인증하지 않습니다. 2015-12-04 17:56:17 CLIENT-> SERVER : QUIT 2015-12-04 17:56:17 SMTP connect () 실패. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Message could not be sent. 메일러 오류 : SMTP connect () 실패. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
이 게시물에 따르면 : PHPMailer-SMTP ERROR : Password command failed when send mail from my server , 어떤 경우에는 이것이 의심스러운 활동이 아니라고 Google을 지정하고 계정에서 보안 수준이 낮은 옵션을 활성화 해야합니다.
이것이 올바른 암호라고 가정합니다 ...
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다