I wrote a function to delete mails.
My mailbox contains 88 messages. I have 40 of them with the subject "reply ".
When i mark all message which has a match as read then this goes ok. When i delete the messages after the first succesfully delete message a error is raised (unique message id could not be found). It seems that the messageid (after removal of 1 message)
changes so that the next match goes wrong. What can i do to resolve this, (except starting over after 1 deleted message, till i dont have a match anylonger?)
I connect to gmail mailbox
Dim connection As New Koolwired.Imap.ImapConnect("imap.gmail.com", 993, True)
Dim command As New Koolwired.Imap.ImapCommand(connection)
Dim authenticate As New Koolwired.Imap.ImapAuthenticate(connection, "", "")
Dim mailbox As Koolwired.Imap.ImapMailbox = command.Select("INBOX")
Dim irecords As Integer = mailbox.Exist
mailbox = command.Fetch(mailbox)
For Each imessage As Koolwired.Imap.ImapMailboxMessage In mailbox.Messages
Dim strFrom As String = imessage.From.Address
Dim strSubject As String = imessage.Subject
If strSubject.ToLower().Contains("reply") Or _