Hi,
Ever since I’ve upgraded to Aspose.NET 20.4 EWSClient.ListMessages with query ability doesn’t return messages.
I tried going back to Aspose.NET 20.3 and it works but then I ran into problems running IMAP client on .net core 3.1 (EMAILNET-39791 was fixed in version 20.4)
I feel like i’m really caught between a rock and a hard place here and will appreciate your help in understanding what was changed in 20.4.
This is a snippet example of code that returns messages in 20.3 but not returning anything in 20.4.
// Connect to EWS
const string mailboxUri = "https://outlook.office365.com/ews/exchange.asmx";
const string username = "--REDUCTED--";
const string password = "--REDUCTED--";
const string domain = "--REDUCTED--";
try
{
IEWSClient client = EWSClient.GetEWSClient(mailboxUri, username, password, domain);
// ExStart:CaseSensitiveEmailsFiltering
// Query building by means of ExchangeQueryBuilder class
ExchangeQueryBuilder builder = new ExchangeQueryBuilder();
builder.HasFlags(ExchangeMessageFlag.IsRead);
MailQuery query = builder.GetQuery();
// ExEnd:CaseSensitiveEmailsFiltering
// Get list of messages
ExchangeMessageInfoCollection messages = client.ListMessages(client.MailboxInfo.RootUri, 100, query, true);
Console.WriteLine("EWS: " + messages.Count + " message(s) found.");
// Disconnect from EWS
client.Dispose();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Thanks in advance!