简体   繁体   English

从具有gmail api的特定电子邮件开始阅读gmail历史记录?

[英]Read gmail history starting from a specific email with php gmail api?

i want know if is possibile read just some email from INBOX and not all email. 我想知道是否可以从INBOX读取一些电子邮件,而不是全部电子邮件。

for example 例如

 $messages = $service->users_messages->listUsersMessages('me');
 $messages->getMessages();  

 ... PREVIUS EMAIL....
 22 oct [facebook]  id : 123
 23 oct [gmail]   id 124
 24 oct [amazon]   id 125

i check at the first time the emails and i store the last id(125) after that if i connect at gmail after 2 month i want to start from id 125 and not read all the email again. 我第一次检查电子邮件,然后存储最后一个id(125),如果我在2个月后使用gmail连接,则我想从ID 125开始,而不是再次阅读所有电子邮件。 is possibile? 是可能的吗?

While doing messages.list, give labelid as "INBOX" and there is one more parameter called "q", where you can specify the query which returns messages matching this query. 在执行messages.list时,将labelid设置为“ INBOX”,还有一个名为“ q”的参数,您可以在其中指定查询,该查询返回与该查询匹配的消息。 check this link support.google.com/mail/answer/7190?hl=en&ref_topic=3394914 to see what are all the supported operators for query. 请查看此链接support.google.com/mail/answer/7190?hl=zh_CN&ref_topic=3394914,以了解所有受支持的查询运算符。

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

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