Marking message as unread

Topics: Help requests
Apr 5, 2013 at 12:22 PM
Hello,

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?
Coordinator
Apr 5, 2013 at 12: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 1:29 PM
That is really awesome. Thanks!
Sep 19, 2013 at 1:10 PM
Hi pavel_azanov,

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

msg.RemoveFlag("UNSEEN");
msg.AddFlag("SEEN");

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


Thanks in advance
J.Jayakumar
Sep 19, 2013 at 1: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.

--Ravi
Sep 19, 2013 at 2: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
msg.RemoveFlag("UNSEEN");
But it doesn't get updated.


Jayakumar
Coordinator
Sep 19, 2013 at 3:32 PM
Edited Sep 19, 2013 at 3: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.
Greets,

Pavel
Sep 20, 2013 at 4: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.


Jayakumar