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

Free Support Forum - aspose.com

Exception: Field ‘Body’ is not supported on using POP3 while filtering by MailQueryBuilder.Body field (C# .NET)

Hi,
I am trying to filter messages on POP3 by mail body and got this exception:
“Field ‘Body’ is not supported”

my code looks like this:
MailQueryBuilder queryBuilder = new MailQueryBuilder();
if (!string.IsNullOrEmpty(pBody))
{
queryBuilder.Body.Contains(pBody);
}

var mails = Pop3MailClient.ListMessages(queryBuilder .GetQuery());

Pop3MailClient.ListMessages throw the exception.
It is not possible to filter messages by body in POP3??

I’m using Aspose.Email, Version=18.1.0.0.

Please help me to solve this issue.
Naomi.

@JoGeorge,

I have observed the issue shared by you and request you to please first try using Aspose.Email for .NET 19.6 on your end. If there is still an issue then please share the feedback with us. I also suggest you to please visit following thread as well for your reference.

Hi,
Thanks for your reply.
For now, I am not able to upgrade for 19.6. I looked at the thread but can’t understand how it help me. I can’t call mailClient.FetchMessages(queryBuilder .GetQuery()). The meaning is - if I want to filter messages by body text I should call FetchMessages method and then loop each message and check if body match to requested body. Doesn’t sound like good idea…
Do you have another solution?

Thanks,
Naomi.

@JoGeorge,

We have investigated your requirements further. Unfortunately POP3 protocol does not support search operations. Search methods for POP3 client implement this operation on the client side. If one needs filtering on a server side, he may use IMAP client as IMAP protocol supports this feature. We also suggest you to please visit link 1 for your kind reference as well.

You may please visit this documentation link for your kind reference.

Hi,
Thanks for your reply.
There is an option in POP3 to search by parameters such as: subject, to, cc etc.
Just to see if i understand - you say in POP3 there is no option to search by body message?

Thanks,
Naomi.

@JoGeorge,

Yes, your understanding is correct.

OK, thank you!