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

Free Support Forum - aspose.com

EWSClient.FetchItem throws "System.ArgumentException

+1 for me!
Just adding that I too have this exact same issue, same error and same observation in terms of failing on items with attachments. Hoping to have some resolution if possible.
Thank you

@mass.saad

In case you are using old version of Aspose.Email for .NET, we suggest you please upgrade to the latest version of Aspose.Email for .NET 22.2.0.

If you still face problem, please attach the following resources here for testing:

  • Your test login credential.
  • Please attach input file if you are using any.
  • Please share the exception detail.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

confirming this issue is occurring on 22.2.0.
Will send through a standalone when i have time but just stating that I too have the same issue as the other reported user

@mass.saad

Please share the requested resources. We will investigate the issue and provide you more information on it.

@mass.saad

The System.ArgumentException issue has been fixed in the latest version of Aspose.Email for .NET 22.3.

It should be noted the FetchItem method doesn’t fetch attachments.

We added the FetchItems(EwsFetchItems options) method to EwsClient. It accepts an instance of EwsFetchItems class as a parameter to control the behavior of the method.

The following code shows how to get items with attachments.

var messageInfoList = ewsClient.ListMessages(ewsClient.MailboxInfo.InboxUri);
var options = EwsFetchItems.Create();
var uriList = messageInfoList.Select(item => item.UniqueUri).ToList();
var items = ewsClient.FetchItems(options.AddUris(uriList).WithAttachments());