使用imap协议Tcpclient将电子邮件标记为已读 [英] Mark email as read using imap protocol Tcpclient

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

问题描述

_imapSw.WriteLine("$ STATUS INBOX (unseen)");
_imapSw.WriteLine("$ SELECT INBOX");
_imapSw.Flush();

在收到看不见的电子邮件计数后,我想将电子邮件标记为已读。请告诉我命令将第一封电子邮件标记为已读。
`

After getting email count of unseen.I want to mark email as read. Please tell me command to mark first email as read. `

_imapSw.WriteLine( $ FETCH + index +(body [header.fields(来自主题日期)]));
_imapSw.WriteLine( $ FETCH + index + body [text]);`

_imapSw.WriteLine("$ FETCH " + index + " (body[header.fields (from subject date)])"); _imapSw.WriteLine("$ FETCH " + index + " body[text]");`

我可以获取电子邮件标头和正文,但这不是将电子邮件标记为已读。

i can fetch email header and body but this is not marking email as read.

推荐答案

选择收件箱时,您将获得第一个未读/未看到邮件的ID。

When selecting the inbox, you get the ID of the first unread/unseen mail.

* FLAGS (\Answered \Flagged \Deleted \Seen \Draft NonJunk $Junk Junk $MDNSent $F
orwarded)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft NonJunk $Junk Jun
k $MDNSent $Forwarded \*)] Flags permitted.
* 8421 EXISTS
* 0 RECENT
* OK [UNSEEN 3395] First unseen.
* OK [UIDVALIDITY 47932578432] UIDs valid
* OK [UIDNEXT 46214] Predicted next UID
* OK [HIGHESTMODSEQ 1377] Highest

然后您可以使用store命令将其标记为已读:

Then you can use the store command to mark it as read:

_imapSw.WriteLine("$ STORE 3395 +flags \\seen");
_imapSw.Flush();

这篇关于使用imap协议Tcpclient将电子邮件标记为已读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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