且构网

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

标记为已读邮件方法

更新时间:2023-12-02 17:49:40

使用threads.modify()或messages.modify()(取决于您要执行的操作),并使用"UNREAD"的removeLabelId.>

https://developers.google.com/gmail/api/v1/reference/users/threads/modify

How do I mark mail as read using Gmail API?

I got the thread of email

Thread thread = service.users().threads().get(userId, message.getThreadId()).execute();

but it does not have method markRead like gmail API site says it should.

use either threads.modify() or messages.modify() (depending on scope of what you want to do) and removeLabelId of "UNREAD".

https://developers.google.com/gmail/api/v1/reference/users/threads/modify