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

Free Support Forum - aspose.com

ExchangeQueryBuilder retrieval of bounced emails with different subjects


I am trying to retrieve bounced emails where the provider bring different subjects, for example

gmail gives in the subject “Undeliverable”, while yahoo is providing “Failure notice”, I don’t believe what I have would work? I mean having two different .Subject.Contains? much less having two words separated by a string inside the .Subject.Contains(“two words”), please advice

ExchangeQueryBuilder builder = new ExchangeQueryBuilder();
builder.Subject.Contains(“Failure Notice”, true);

I really don’t need to find out who the provider is, I need to query emails that have different subjects, please let me know how to retrieve emails just on different subject values a code example would be great

Hi Luis,

Thank you for contacting Aspose support team.
You may please give a try to the following sample code and share the feedback.

ExchangeQueryBuilder builder = new ExchangeQueryBuilder();
builder.Or(builder.Subject.Contains("Undeliverable", true), builder.Subject.Contains("Failure Notice", true));
MailQuery query = builder.GetQuery();