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

Free Support Forum - aspose.com

Pop3Client.ListMessages(MailQuery)

We are using Aspose Version 14.2.1. We have a situation where we encounter a message with an empty To field. If we try to do the following:


var messageQueryBuilder = new MailQueryBuilder();
messageQueryBuilder.To.Contains("blah@blah.com");
var mailQuery = messageQueryBuilder.GetQuery();

pop3Client.ListMessages(mailQuery);

will fail with:

+ ex {“Value cannot be null.\r\nParameter name: field”} System.Exception {System.ArgumentNullException}


I also tried

var messageQueryBuilder = new MailQueryBuilder();
messageQueryBuilder.To.Contains("blah@blah.com");
messageQueryBuilder.To.NotEmpty();
var mailQuery = messageQueryBuilder.GetQuery();

pop3Client.ListMessages(mailQuery);

but that appears to work on each item in the collection it does not handle where the To collection is empty (i.e. !To.Any()).

Any help would be greatly appreciated.

Hi,

Thank you for contacting Aspose support.

I have tested this issue at my end with an empty To field in a sample message. However, with the latest version of Aspose.Email for .NET 4.4.0, I was unable to observe any issue as you have mentioned. Could you please give it a try using this latest version and let us know your feedback? We’ll assist you further accordingly in this regard.