0 mit Google Oauth und ich erhalte diese Störungkeine E-Mail PHPMailer 6.0 mit Oauth Google
2017-08-04 06:38:42 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP v19sm895098pgc.93 - gsmtp
2017-08-04 06:38:42 CLIENT -> SERVER: EHLO localhost
2017-08-04 06:38:43 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [180.243.143.147]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
2017-08-04 06:38:43 CLIENT ->; SERVER: STARTTLS
2017-08-04 06:38:43 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
2017-08-04 06:38:43 CLIENT -> SERVER: EHLO localhost
2017-08-04 06:38:43 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [180.243.143.147]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
SMTP Error: Could not authenticate.
2017-08-04 06:38:43 CLIENT -> SERVER: QUIT
2017-08-04 06:38:43 SERVER -> CLIENT: 221 2.0.0 closing connection v19sm895098pgc.93 - gsmtp
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
Mein Skript
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require './vendor/autoload.php';
$mail = new PHPMailer;
$mail->isSMTP();
$mail->SMTPDebug = 2;
$mail->Debugoutput = 'html';
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->AuthType = 'XOAUTH2';
$mail->oauthUserEmail = "[email protected]";
$mail->oauthClientId = "932857915584-eco8v9aejdb2n3mkltgvftf8e5h1eiko.apps.googleusercontent.com";
$mail->oauthClientSecret = "7SqFo7aPYvZ05cHlh5p3kMUD";
$mail->oauthRefreshToken = "1/4KJJ5XMyXqELMAhRXGYjz_I4SfoWfFR9N9RRA2VA2I0";
$mail->addAddress('[email protected]'); // Add a recipient
$mail->isHTML(true); // Set email format to HTML
$mail->setFrom('[email protected]', 'Mailer');
$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()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}
ich habe keine Ahnung, senden, die ich getan habe Suche Google, aber ich finde keine Lösung. Bevor ich frage in Can't Send PHPMailer with Oauth Google
Jede Lösung für meinen Fall?
Wenn Sie die 6.0-Verzweigung verwenden möchten, verwenden Sie [das oauth-Beispiel aus derselben Verzweigung] (https://github.com/PHPMailer/PHPMailer/blob/6.0/examples/gmail_xoauth.phps); Es funktioniert nicht mehr so wie früher. – Synchro
Danke :) seine Arbeit für mich –