ImapClient.FlagMessageByUID(UId, Flag.Unflagged)I want to remove a flag from the mail so i am using this function but it does not work for me.
I had used this function for other flag for example read, flaggged etc and it is working fine for other flag but not working for Unflagged.
Negative flags (unseen, unflagged) can't be assigned. You need to remove positive flags (seen, flagged) instead. Please use Imap.UnflagMessageByUID:
ImapClient.UnflagMessageByUID(UId, Flag.Flagged);