We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

ImapClient.ListMessages Value does not fall within the expected range

Using aspose.Email version

We are trying to connect to a certain imap server (a company one, which technology is unknown) using the ImapClient class.

When attempting to recover the first n emails (using ImapClient.ListMessages(n)), an exception occurs, which makes it unable to recover any emails at all. It does not happen when attempting to select a folder, recover a single message or other operations, though.

The problem only appears when connecting to cetain imap servers. These servers are managed by the companies so the concrete imap protocol version they follow is unknown. We can connect to these servers using other imap clients, like thunderbird, though.

The reported exception when invoking the method ImapClient.ListMessages(10) is the following:

en . (IAsyncResult )
en . ()
en Aspose.Email.Imap.ImapClient.( , Int32 , Int32 )
en Aspose.Email.Imap.ImapClient.( , Int32 )
en Aspose.Email.Imap.ImapClient.ListMessages(Int32 maxNumberOfMessages)

HResult: -2147024809
InnerException: null
Message: El valor no está dentro del intervalo esperado. (Value does not fall within the expected range.)

I would like a solution to this problem because it stops us from offering a service to our clients. Being unable to call this method kills our whole feature.

Thank you.


I have found that you are using a very old version of API on your end. I suggest you to please try using latest Aspose.Email for .NET 20.5 and in case you still face issue, please share a working sample code reproducing the issue on your end.