简体   繁体   English

使用exchangelib将电子邮件标记为已读

[英]Mark email as read with exchangelib

I am using Pythons exchangelib package. 我正在使用Pythons exchangelib包。 How can I mark an e-mail as read with exchangelib? 如何使用exchangelib将电子邮件标记为已读?

I have had a look at the official GitHub exchangelib page for my query, but didn't find the answer. 我查看了我的查询的官方GitHub exchangelib页面 ,但没有找到答案。

To add to joe's comment, you must also 'save' the item for the flag to be permanent. 要添加到joe的注释,您还必须“保存”该项目以使该标志成为永久性的。

item.is_read = True
item.save()

item.is_read = True应该执行其中item是要标记为read的消息的技巧

To add to HeroicOlive's comment, if you specifically want to save the is_read value only, try: 要添加到HeroicOlive的注释,如果您只想保存is_read值,请尝试:

item.is_read = True
item.save(update_fields=['is_read'])

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

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