Free Support Forum - aspose.com

Getting " Imap server returned an invalid response" exception from ListMessages method

I have an application, that fetches emails from Gmail using Imap service. there will be more than 500 emails per day. After processing 200 or 300 emails, application will throw “Imap server returned an invalid response” exception and after that client will not pick any more. please see the code below. ALso I am using older version of aspose email (6.9.0.0)

ImapClient client = new ImapClient
(
imap.gmail.com”,
993,
your.username@gmail.com”,
“your.password”;
);
client.SecurityOptions = SecurityOptions.SSLAuto;
//Generate the Query used to fetch the EMails
ImapQueryBuilder imapQueryBuilder = new ImapQueryBuilder();
imapQueryBuilder.HasNoFlags(ImapMessageFlags.IsRead);
MailQuery query = imapQueryBuilder.GetQuery();
//–End---------------------------------------------
//—Setting the mailbox and fetching the mails based on the query defined above
client.SelectFolder(“Inbox”);
ImapMessageInfoCollection messageInfoCol = client.ListMessages(query, 100);

@sreenath2020

You are using one of very old API version on your end. I suggest you to please try using latest Aspose.Email for .NET 20.8 on your end. In case there is still an issue then please share the test account details along with snapshot of the issue incurring on your end.

Thanks @mudassir.fayyaz

Hi @mudassir.fayyaz ,

I am planning to use trial version of Aspose Email to see everything is working as expected. So functionality wise do we have any limitation for trial version

@sreenath2020

You can try using the trial version but better would be that you may obtain 30 Day free trial license to use the API with full strength on your end.

Thank you very much for the support

@sreenath2020

You are always welcome.