且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法通过Oauth Google发送电子邮件PHPMailer 6.0

更新时间:2023-12-04 12:57:10

几件事:

首先,无论如何,OAuth确实很难调试.我真的建议您看看 6.0分支,其中的OAuth支持显着改善.它附带了更好的示例,如果您可以帮助测试它将非常有用.第二步是关键点,可能会解决您的问题.初始化方面略有不同(请使用PHPMailerOAuth类),因此请仔细阅读文档.

First, OAuth is really hard to debug anyway. I really recommend that you take a look at the 6.0 branch, in which the OAuth support is significantly improved. It comes with much better examples, and it would be very useful if you could help test it. This second step is key point and might solve your problem. There is slight difference in initiation( Use PHPMailerOAuth class), so please read the docs carefully.

第二,通过文档,您可能已经遵循了,但是看看是否缺少任何步骤.

Second, Go through this documentation, you might have followed it, but see if you are missing any step.

第三,您确定获得刷新令牌而不是普通令牌吗?

Third, Are you sure you got a refresh token and not a normal token?

尝试这些方法,让我知道,是否对您有用?

Try these things and let me know, if it worked for you or not?