0 votes
by (990 points)

in my example program the call of GetMessage() set's always the seen-flag on message that is download. How can i avoid this?

oImap.GetMessage(oMessageInfo.UniqueId, srMsgMemStream)

I've already sent you the logfile per email.

Applies to: Rebex Secure Mail

1 Answer

+1 vote
by (146k points)
Best answer

By default, Rebex IMAP marks messages as Seen (that's what read messages are called in IMAP) when you call GetMessage/GetMailMessage/GetMimeMessage, or GetMessageInfo/GetMessageList with ImapListFields.Body flag.

This behavior can be disabled using `UsePeekForGetMessage` option:


Imap client = new Imap();
client.Settings.UsePeekForGetMessage = true;


Dim client As New Imap()
client.Settings.UsePeekForGetMessage = True

If you are using one of the older versions of Rebex components, please use the old Options property like this:


client.Options |= ImapOptions.UsePeekForGetMessage;


client.Options = client.Options Or ImapOptions.UsePeekForGetMessage

(where "client" is an instance of "Imap" object)