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: larssy1 **
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: larssy1 **
Hi Pavel,
No problem, thanks for reviewing this issue after all :)
The problem still happens. On line 123 of EmailParser.cs.
A few things i've noticed:
_emailItems has the value {string[0]}
current is 0
_emailItems.Length is 0
Which results in:
```
stringBuilder.Append(this._emailItems[0 >=0 ? 0 - 1 : 0]);
```
If you need more information, please contact me :)