+1 vote

Hello ^^

My question is : is it possible to filter emails by domain using imap search component. I would like to filter an inbox excluding all the mails from my domain bca.fr ???

Thank you


1 Answer

0 votes
Best answer

You can use Expression.From method (it creates criterion to find
messages that contain the specified string in the envelope structure's
FROM field):

List<long> uids = imap.Search(Expression.From("bca.fr"));


by (298k points)