尝试访问我的本地Web应用程序的google.com时出错 [英] Error while trying to get access to google.com for my local web application

查看:277
本文介绍了尝试访问我的本地Web应用程序的google.com时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望有人能给我一些关于这个问题的帮助指示!我生气了!
事实是这样的:
我想通过我的本地Web应用程序使用Google SMTP发送电子邮件。我在应用程序的根文件夹中创建了一个.json文件,如下所示:

  {
require:{
phpmailer / phpmailer:^ 5.2,
league / oauth2-client:^ 1.0
}}
pre>

为了通过编译器下载并安装PHPMailer和需要的oauth2client。
然后,我在 Google开发者控制台中创建了一个新项目,并配置了它:我启用了Gmail API,获得正确的凭据(ID和SECRET),并设置这样的授权直接URI:

  http:// localhost / folder1 / vendor / phpmailer / phpmailer / get_oauth_token.php 

现在我编辑了get_oauth_token.php,凭证,但是当我尝试在浏览器中插入以前的URI以获取错误发生的权限时:


致命错误:类别'League\OAuth2\Client\Provider\Google'未找到 C:\xampp\htdocs\folder1\vendor\phpmailer\phpmailer\第28行的get_oauth_token.php


我不能继续..我试图发送和发送电子邮件主要的php脚本,但显然我不能得到访问和我的请求被服务器拒绝。有什么建议么?
感谢并有美好的一天!

解决方案

有完全相同的问题。我做的是安装:

 作曲家需要联盟/ oauth2-google 
/ pre>

,问题消失



;)


I hope someone of you can give me some helpful instructions about this problem! I'm getting mad! The fact is this: I would like to send emails by my local web application using Google SMTP. I created a .json file in the root folder of my application like this:

{
"require": {
    "phpmailer/phpmailer": "^5.2",
    "league/oauth2-client": "^1.0"
}}

In order to download and install by compiler the PHPMailer and the oauth2client that is needed. Then I created a new project in the google developer console and I configured it: I enabled gmail API, obtained the correct credentials (ID and SECRET) and set the authorized direct URI like this:

http://localhost/folder1/vendor/phpmailer/phpmailer/get_oauth_token.php

Now I edited the get_oauth_token.php with the obtained credentials, but then when I try to insert the previous URI in the browser to get the permissions an errror is occurring:

Fatal error: Class 'League\OAuth2\Client\Provider\Google' not found in C:\xampp\htdocs\folder1\vendor\phpmailer\phpmailer\get_oauth_token.php on line 28

And i can't go on.. I tried to send and email with a main php script but obviously i can't get access and my request is refused by the server. Any suggestions? Thanks and have a nice day!

解决方案

had the exact same problem. what i did was to install:

composer require league/oauth2-google

and the problem dissapear

;)

这篇关于尝试访问我的本地Web应用程序的google.com时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆