标记为已读邮件方法 [英] Mark as read mail method

查看:110
本文介绍了标记为已读邮件方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Gmail API将邮件标记为已读?

我收到了电子邮件线索

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

但它没有方法 markRead ,如gmail API网站所说的那样.

解决方案

使用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

这篇关于标记为已读邮件方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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