Fetch an email with imaplib but do not mark it as SEEN

谁说胖子不能爱 提交于 2019-11-26 22:23:05
lezardo

You might also set read_only to true when selecting the folder:

imap_conn.select('Inbox', readonly=True)

The following should work:

typ, msg_data = imap_conn.fetch(uid, '(BODY.PEEK[HEADER])')

or BODY.PEEK[TEXT], etc.

You can use (RFC822.PEEK) as the "message-parts" argument, according to RFC 1730 (I have not verified which servers actually implement that correctly, but it doesn't seem hard for them to).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!