+1 vote
by (190 points)
edited

Hi

I think this is my last question, I'm using IMAP for list messages, retrive headers and extract some content for the mails, all this works perfect.

The last thing to do is marke the message as readed. I found code to copy the message to another folder and delete and purge, as I'm using Gmail account, I prefer only mark the message as read, it's important because I check only for new messages to extract information of them.

Using VB.Net

Thanks for your help.

Applies to: Rebex Secure Mail

2 Answers

0 votes
by (144k points)
edited
 
Best answer

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 switched off using ImapOptions.UsePeekForGetMessage).

If you need to mark messages as Seen without using one of these methods, use the SetMessageFlags method:

''# create client, connect and log in 
Dim client As New Imap
client.Connect("imap.example.org")
client.Login("username", "password")

''# select folder 
client.SelectFolder("Inbox")

''# mark the first message in Inbox as "read":
client.SetMessageFlags(1, ImapFlagAction.Add, ImapMessageFlags.Seen)
0 votes
by (140 points)
edited

how know email read or unread with smpt or imap please helpe me

...