简体   繁体   English

如何通过php中的api获取gmail收件箱消息?

[英]how to get gmail inbox messages through api in php?

Actually i followed the steps that given by google .其实我按照谷歌给出的步骤。 (Source : https://developers.google.com/gmail/api/quickstart/php ) (来源: https : //developers.google.com/gmail/api/quickstart/php

But Finally i execute quickstart.php through terminal , then i got only Labels Names Not messages .i Received output like this ...但最后我通过终端执行 quickstart.php,然后我只得到标签名称而不是消息。我收到这样的输出......

Labels:标签:

- CATEGORY_UPDATES
- UNREAD
- DRAFT
- CATEGORY_PROMOTIONS
- INBOX
- CATEGORY_SOCIAL
- CATEGORY_PERSONAL
- CATEGORY_FORUMS
- TRASH
- CHAT
- IMPORTANT
- SENT
- STARRED
- SPAM 

i don't know what to do further to get inbox messages ..我不知道该怎么做才能收到收件箱消息..

在此处输入图片说明

Can anyone please guide me.任何人都可以请指导我。 also tell me if any other methods to get gmail messages and hangouts messages.. thanks in advance.还请告诉我是否有任何其他方法可以获取 Gmail 消息和环聊消息.. 提前致谢。

Old thread but maybe this helps someone旧线程,但也许这有助于某人

    $optParams = array(
        "labelIds" => $mailbox,
        "maxResults" => $maxMsgs,
    );
    $resultMessages = $service->users_messages->listUsersMessages($user, $optParams);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM