Free Support Forum - aspose.com

Exchange.ListMessages doesn't return (C#)

Hi,
I’m working with Exchange mail client. While I’m filtering mail by To.Address or To.DisplayName field it doesn’t work, call is blocked on Exchange.ListMessages function and doesn’t returns.
While filtering mail by other fields like Subject or From it works fine.

Here below my snippet code:
Creating Query:
MailQuery mq = null;
ExchangeQueryBuilder qb = new ExchangeQueryBuilder();
qb.Or(qb.From.Contains(pFromAddress), qb.From.Contains(pFromName));
qb.To.Contains(pTo);
mq = qb.GetQuery();
return mq;

Create mail client:
NetworkCredential credentials = new NetworkCredential(UserName, Password, Domain);
IEWSClient MailClient = EWSClient.GetEWSClient(ServerHost, credentials);

Get mails by query:
MailClient.ListMessages(pSubfolderUri, pMaxResult, pMailQuery); --> this line blocks and doesn’t return.

@yoniab

Apparently from code there seems to be no issue. We need to investigate this on our end and request you to please share the test account credentials that we may use to verify the same on our end.