Quantcast
Channel: ImapX 2
Viewing all articles
Browse latest Browse all 1952

Commented Issue: Message.Process results in IndexOutOfRangeException [1486]

$
0
0
Dear Coders,

I've just started using your ImapX library to retrieve and read mails from gmail.
Now, everything is working fine and it's a great library.

However, when i'm trying to mark a mail read using the Message.Process() option, it returns the IndexOutOfRangeException.

```
foreach (ImapX.Message message in GmailUser.Instance.Messages.OrderByDescending(w => w.Date))
{
if (SendWebRequest(url))
{
message.Process();
amountRead++;

Dispatcher.BeginInvoke(new MethodInvoker(delegate
{
this.btnRead.Content = "Read [" + amountRead + "/" + GmailUser.Instance.Messages.Count + "]";
}));
}
else
{
failedMessages.Add(message);
}
}
```

Thanks in advance.

Yours Sincerely,
Lars
Comments: ** Comment from web user: pavel_azanov **

Hi,

the Message.Process method isn't thought for marking the messages as read. It only downloads and parses the message completely.

I know it is not very intuitive, and is something that was inherited from the original ImapX project.

If you need to mark a message as read, use the Message.SetFlag method:

myMessage.SetFlag(ImapFlags.SEEN);


Viewing all articles
Browse latest Browse all 1952

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>