+1 vote

Hi

I am using limilabs mail.dll to read mails from yahoo inbox.

I need to filter the emails using a particular from address and a subject.

For eg:
I need to get only mails came from 'xyz@yahoo.com' with subject 'sample mail'.

I am using imap.

Please provide help for the above one.

Thank you.

by

1 Answer

0 votes

To create more complicated IMAP searches use Expression API.

Following is the query that matches subject and from address:

List<long> uids = imap.Search().Where(
    Expression.And(
        Expression.Subject("sample mail"),
        Expression.From("xyz@yahoo.com")));

Please note the search is always performed on the server side.

You can find different IMAP search options in this article.

by (297k points)
...