小编Ana*_*han的帖子

使用Gmail API从PHP中读取Gmail中的邮件

我已经从Google PHP客户端库中下载了新的Gmail API源代码.

我使用以下方法启动了服务:

set_include_path("./google-api-php-client-master/src/".PATH_SEPARATOR.get_include_path());

require_once 'Google/Client.php';   
require_once 'Google/Service/Gmail.php';

$client = new Google_Client();
$client->setClientId($this->config->item('gmailapi_clientid'));
$client->setClientSecret($this->config->item('gmailapi_clientsecret'));
$client->setRedirectUri(base_url('auth'));
$client->addScope('email');
//$client->addScope('profile');     
$client->addScope('https://mail.google.com');           
$client->setAccessType('offline');

$gmailService = new Google_Service_Gmail($client);
Run Code Online (Sandbox Code Playgroud)

接下来我该怎么办?如何使用Gmail API PHP库阅读Gmail邮件?

gmail-api

17
推荐指数
3
解决办法
3万
查看次数

如何使用gmail api php发送电子邮件

如何使用gmail api php发送电子邮件

$msg['raw'] = "This is sample test message";            
$msg['To'] = "test.api@gmail.com";
$msg['subject'] = "Sample test subject";
Run Code Online (Sandbox Code Playgroud)

目前我正在使用$ message = $ service-> users_messages-> send('me',$ msg);

主题是什么?

gmail-api

1
推荐指数
2
解决办法
1万
查看次数

标签 统计

gmail-api ×2