0 votes

hi,
Is there any option for checking single message as seen or unseen

by

1 Answer

0 votes
 
Best answer

Use Imap.GetFlagsByUID method:

bool isSeen = imap.GetFlagsByUID(uploaded).Contains(Flag.Seen);

To mark message seen unseen you can use:

imap.MarkMessageSeenByUID(uploaded);
imap.MarkMessageUnseenByUID(uploaded);

Remember that most Imap.Get** methods, such as *Imap.GetMessageByUID automatically mark message as seen. You can use Imap.Peek** equivalents (e.g. *Imap.PeekMessageByUID) if you don't want that behavior. (Imap.GetFlagsByUID is one of the few methods that don't change the seen/unseen status)

by (301k points)
...