This project is read-only.

Marking message as unread

Topics: Help requests
Apr 5, 2013 at 1:22 PM

I was wondering if it is possible to mark a message as unread (unseen). I already noticed it is possible to mark a message as SEEN. Is it possible to remove a flag, specifically the Seen flag?
Apr 5, 2013 at 1:54 PM
Hello vzorge,

if you want to mark a message as “unread” again, you need to remove the SEEN flag. I updated the source code in the repository (not the binaries!, will be updated with the next release coming soon), the Message.SetFlag method is now deprecated, and you can use the Message.AddFlag and Message.RemoveFlag to deal with your task.

Best regards,

Pavel Azanov
Apr 5, 2013 at 2:29 PM
That is really awesome. Thanks!
Sep 19, 2013 at 2:10 PM
Hi pavel_azanov,

Whether this has been fixed in the current version.
Why because it doesn't worked for me


whether i am correct
Pls Help me, how to overcome this issue

Thanks in advance
Sep 19, 2013 at 2:59 PM
Your code seems to be marking the message as read, not unread. I think you want to remove the "SEEN" flag and add the "UNSEEN" flag.

Sep 19, 2013 at 3:34 PM
Hi Ravi,

Actually i am going to get the unread mails and after i have to make it as read mails
I follow both the steps
But it doesn't get updated.

Sep 19, 2013 at 4:32 PM
Edited Sep 19, 2013 at 4:33 PM
Hi Jayakumar,

just read my second post in this thread carefully. The flag UNSEEN doesn't exist (see constants in ImapFlags), so has no effect. Every read message will have the SEEN flag set, so to mark it as unread again, you need to remove it:
// msg is read, has the SEEN flag set.

msg.RemoveFlag(ImapFlags.SEEN); // Removing SEEN flag, marking message as unread again.

Sep 20, 2013 at 5:45 AM
Hi Pavel,

Thanks a lot , It has worked out well.

I thought that while searching the unread messages we use "UNSEEN" so i followed that.