며칠 동안 PHPMailer를 gmail로 실행 시키려고했는데 도움이 필요합니다. 나는 여기 또는 Google에서 찾을 수있는 거의 모든 것을 읽었지 만 지금까지 도움이 된 아이디어는 없습니다. 사용 중 * Windows 7 Home Basic * Wampserver 2.2와 PHP vers. PHP 버전 5.4.3 필요한 모든 확장이 e처럼 설정됩니다. 지. 나는 이미 어떤 변화를 시도하고있다PHPMailer가 Gmail과 함께 작동하지 않습니다.
<?php
//require 'PHPMailerAutoload.php'; // <<== I have tried this also - no sucess
require 'class-phpmailer.php';
require "class-smtp.php"; //"PHPMailerAutoload.php";
// $mail->PluginDir //WB, 30 Nov 2014:omited if all files from phpmailer are in the same folder
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtp.gmail.com";
$mail->Mailer = 'smtp';
$mail->SMTPAuth = true;
// I have tried both - TLS and SSL - with the required ports ==>> both are not working
$mail->Port = 465;
$mail->SMTPSecure = 'ssl';
// or try these settings (worked on XAMPP and WAMP):
//$mail->Port = 587;
//$mail->SMTPSecure = 'tls';
$mail->Username = "wie****@gmail.com"; //my password ==>> works if I make a login oline to my account
$mail->Password = "*************"; //my password ==>> works if I make a login oline to my account
$mail->SMTPDebug = 2; // <<== enables SMTP debug information (for testing)
$mail->IsHTML(true); // if you are going to send HTML formatted emails
$mail->SingleTo = true; // if you want to send a same email to multiple users. multiple emails will be sent one-by-one.
$mail->From = "wie****@gmail.com"; //my gmail mail account
$mail->FromName = "My Name";
$mail->addAddress("art******@yahoo.com","art******"); //my yahoo mail account
//$mail->addAddress("[email protected]","User 2");
//$mail->addCC("[email protected]","User 3");
//$mail->addBCC("[email protected]","User 4");
$mail->Subject = "Testing PHPMailer with localhost";
$mail->Body = "Hi,<br /><br />This system is working perfectly.";
if(!$mail->Send())
echo "Message was not sent <br />PHPMailer Error: " . $mail->ErrorInfo;
else
echo "Message has been sent";
?>
내가 인터넷에서 찾을 수 있지만 아무것도 작동하지 않습니다 : php_opensll * PHPMailer 5.2.9
이것은 내가 사용하고있는 스크립트입니다.
나는 그것을 시도 - 'PHPMailerAutoload.php'와 'class.phpmailer.php를'클래스 필요 - "$ 메일 -> SMTPSecure = 'SSL';"와 "$ 메일 -> 포트 = 465 ; " 뿐만 아니라 와 -"$ 메일 -> SMTPSecure = 'TLS'; "와"$ 메일 -> 포트 = 587; "여기
디버깅 로그 파일입니다Debug-Log when using TLS with port 587
SMTP -> FROM SERVER:220 mx.google.com ESMTP cq6sm24503844pad.30 - gsmtp SMTP -> FROM SERVER: 250-mx.google.com at your service, [121.54.112.183] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8 SMTP -> FROM SERVER:220 2.0.0 Ready to start TLS SMTP -> FROM SERVER: 250-mx.google.com at your service, [121.54.112.183] 250-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8 SMTP -> ERROR: Password not accepted from server: 534-5.7.14 Please log in via your web browser and 534-5.7.14 then try again. 534-5.7.14 Learn more at 534 5.7.14 https://support.google.com/mail/bin/answer.py?answer=78754 cq6sm24503844pad.30 - gsmtp SMTP -> FROM SERVER:250 2.1.5 Flushed cq6sm24503844pad.30 - gsmtp SMTP -> FROM SERVER:530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 cq6sm24503844pad.30 - gsmtp SMTP -> ERROR: MAIL not accepted from server: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 cq6sm24503844pad.30 - gsmtp The following From address failed: [email protected] : MAIL not accepted from server,530,5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 cq6sm24503844pad.30 - gsmtp
SMTP server error: 5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 cq6sm24503844pad.30 - gsmtp Message was not sent PHPMailer Error: The following From address failed: [email protected] : MAIL not accepted from server,530,5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 cq6sm24503844pad.30 - gsmtp
SMTP server error: 5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 cq6sm24503844pad.30 - gsmtp
SMTP server error: 5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 cq6sm24503844pad.30 - gsmtp
Debug-Log when using SSL with port 465
SMTP -> FROM SERVER:220 mx.google.com ESMTP kj9sm24304154pbc.37 - gsmtp SMTP -> FROM SERVER: 250-mx.google.com at your service, [121.54.112.183] 250-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8 SMTP -> ERROR: Password not accepted from server: 534-5.7.14 Please log in via your web browser and 534-5.7.14 then try again. 534-5.7.14 Learn more at 534 5.7.14 https://support.google.com/mail/bin/answer.py?answer=78754 kj9sm24304154pbc.37 - gsmtp SMTP -> FROM SERVER:250 2.1.5 Flushed kj9sm24304154pbc.37 - gsmtp SMTP -> FROM SERVER:530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 kj9sm24304154pbc.37 - gsmtp SMTP -> ERROR: MAIL not accepted from server: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 kj9sm24304154pbc.37 - gsmtp The following From address failed: [email protected] : MAIL not accepted from server,530,5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 kj9sm24304154pbc.37 - gsmtp
SMTP server error: 5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 kj9sm24304154pbc.37 - gsmtp Message was not sent PHPMailer Error: The following From address failed: [email protected] : MAIL not accepted from server,530,5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 kj9sm24304154pbc.37 - gsmtp
SMTP server error: 5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 kj9sm24304154pbc.37 - gsmtp
SMTP server error: 5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 kj9sm24304154pbc.37 - gsmtp
gmail이 디버깅과 함께 제공하는 링크를 확인했습니다. 그러나 아무것도 작동하지 않습니다. 사용자 및 암호와 동일한 정보로 웹에서 내 계정에 로그인 할 때 작동합니다.
나는 또한 덜 안전한 응용 프로그램을 허용하기 위해 그물에서 찾은 조언을 따랐다. 또한 링크를 사용하여 Google 계정에 대한 액세스를 허용했습니다. https://accounts.google.com/DisplayUnlockCaptcha
그런 다음 포트 스캐너로 포트를 확인했는데 두 포트 모두 폐쇄로 언급되었습니다. 그러나 나는 그들이 신청서에 의해 요청 될 때 열릴 것이라고 생각한다. telnet smtp.gmail.com을 통한 확인이 성공적이었습니다.
바이러스 백신 및 방화벽을 실행하지 않고 스크립트를 시도했지만 결과가 없습니다.
천천히 천천히 나는이 문제에 약간 미치게 달린다. 누군가 나를 도와 줄 수 있습니다.
안드레아스
포트 25를 사용해보세요. – roullie