I keep getting the following exception error with PopClient.GetMessage(int messageNumber) even though the messageNumber that I’m passing in clearly exists and is returned with ListMessages. I don’t have this problem with the ImapClient. What seems to be the problem here?
System.ArgumentException: “Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.”
Is it possible for you to create a Visual Studio project that reproduces your issue and send it to us by submitting a support ticket?
We will need to investigate exactly what does occasions are when the execution fails.
Is it possible that your inbox ends up being empty at some point?
Or that the message is moved/deleted?
Or something else?
In any case, we’ll need to debug this scenario in order to investigate what exactly is happening and why.
Thanks for your response, Mario. It seems that the issue had to do with some of my messages. When I test GetMessage(int messageNumber) on new messages, it always works. I’ll let you know if I run into further issues.