该脚本当前仅支持Google,Microsoft和Yahoo OAuth2提供程序。 -phpmailer

问题描述 投票:0回答:1

[嗨,我正在关注此https://github.com/PHPMailer/PHPMailer/wiki/Using-Gmail-with-XOAUTH2用phpmailer设置auth2令牌。问题是,我得到的消息是“此脚本当前仅支持Google,Microsoft和Yahoo OAuth2提供程序”,而不是获得刷新令牌。当然,我正在检查我的Gmail帐户。有什么想法吗?

phpmailer
1个回答
0
投票

如果您查看the script that creates that message

$providerName = '';
if (array_key_exists('provider', $_GET)) {
    $providerName = $_GET['provider'];
    $_SESSION['provider'] = $providerName;
} elseif (array_key_exists('provider', $_SESSION)) {
    $providerName = $_SESSION['provider'];
}
if (!in_array($providerName, ['Google', 'Microsoft', 'Yahoo'])) {
    exit('Only Google, Microsoft and Yahoo OAuth2 providers are currently supported in this script.');
}

这表明您尚未在URL中包含provider属性,或者该属性存在,但其值不受支持。找出原因,您将发现错误。

请记住,这是一个尝试与多个提供程序一起使用的通用脚本;您可以通过使其仅使用单个提供程序来简化很多操作。

© www.soinside.com 2019 - 2024. All rights reserved.