Imap SetMessageFlags Method

+1 vote
asked Mar 10, 2011 by martin (990 points)
edited Mar 24, 2011

Is there a possiblity fo upload all flags with one call of this function? If i'm right i must call this function for each change of each flag.

Applies to: Rebex Secure Mail

1 Answer

+1 vote
answered Mar 10, 2011 by Lukas Pokorny (120,490 points)
edited Mar 10, 2011

Yes, this is possible:

C#:

Imap imap = new Imap();
...
imap.SetMessageFlags(id, ImapFlagAction.Replace, ImapMessageFlags.Flagged | ImapMessageFlags.Answered | ImapMessageFlags.Seen);

VB.NET:

Dim imap as New Imap
...
imap.SetMessageFlags(id, ImapFlagAction.Replace, ImapMessageFlags.Flagged Or ImapMessageFlags.Answered Or ImapMessageFlags.Seen)

This will set "Flagged", "Answered" and "Seen" flags on the specified message and remove any other flags.

...