प्रमाणीकृत नहीं कर सका मैं अब एक PHP सर्वर पर PHPMailer चला रहा हूं। सब कुछ जब तक 3 दिन पहले ठीक था जब मैं निम्न त्रुटि हो रही शुरू कर दिया: कोड हैPHPMailer -
यहाँ पर
SMTP Error: Could not authenticate.
कम सुरक्षित ऐप्स की अनुमति दें जाता है:
function SendEmail($to,$cc,$bcc,$subject,$body) {
require 'PHPMailerAutoload.php';
$mail = new PHPMailer(true);
$mail->SMTPDebug = 1;
try {
$addresses = explode(',', $to);
foreach ($addresses as $address) {
$mail->AddAddress($address);
}
if($cc!=''){
$mail->addCustomHeader("CC: " . $cc);
}
if($bcc!=''){
$mail->addCustomHeader("BCC: " . $bcc);
}
$mail->IsSMTP();
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->SMTPSecure = "tls"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 587;
$mail->Username = "[email protected]"; // SMTP username
$mail->Password = "myemailpass"; // SMTP password
$webmaster_email = "[email protected]"; //Reply to this email ID
$name=$email;
$mail->From = $webmaster_email;
$mail->FromName = "Service";
//$mail->AddReplyTo($webmaster_email, "DiFractal Customer Service");
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Subject = $subject;
$mail->Body = $body;
return $mail->Send();
} catch (phpmailerException $e) {
$myfile = fopen("debug_email.txt", "w");
fwrite($myfile,$e->errorMessage() . "\n" . $mail->ErrorInfo);
fclose($myfile);//Pretty error messages from PHPMailer
} catch (Exception $e) {
$myfile = fopen("debug_email_stp.txt", "w");
fwrite($myfile,$e->getMessage());
fclose($myfile);//Pretty error messages from PHPMailer
}
}
नोट मैं सिर्फ अद्यतन समस्या का समाधान करने के लिए नवीनतम संस्करण में PHPMailer लेकिन कुछ भी नहीं बदला है! पुराना संस्करण 5.2.2 अभी भी एक ही समस्या है!
संपादित करें: मेरे पास सिर्फ एक सफल ईमेल Google के माध्यम से जाता है और ठीक से भेजा जाता है। जो अब मुझे सवाल करता है अगर यह अंतराल मुद्दा है या उस तरह का कुछ है। क्या किसी को पता है कि phpmailer उच्च लोड के तहत कैसे काम करता है या यदि उच्च लोड उपर्युक्त त्रुटि का कारण बन सकता है?
एक बहुत आम सवाल है। क्या आपने [** google **] चेक किया है (https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=phpmailer%20gmail%20could%20not%20 प्रमाणीकरण)? –
@Michael_B बेशक। मेरे लिए मानक प्रक्रिया स्टैक पर पोस्ट करने से पहले Google से खोज परिणामों के पहले पृष्ठ पर शोध करना है। –
मेरे लिए मानक प्रक्रिया, जब एक प्रश्न बहुत आम है, पूछना है। अधिकांश आपके जितना मेहनती नहीं हैं :-) –