0 votes

Hi

I am in a situation to trace the replies of the mails as below

  1. I sent a mail from a@xyz.com to b@xyz.com
  2. return from b@xyz.com again i sent a reply to the address a@xyz.com
  3. next as a re: reply from a@xyz.com i sent another mail to b@xyz.com

Here from b@xyz.com I need to find the reply came from the same mail i sent to a@xyz.com.

How to find from which mail i had the reply.

Thank you.

by

1 Answer

0 votes

You can use Imap.Search and Expression.Header to serach over In-Reply-To and References email headers:

List<long> uids = imap.Search().Where(
    Expression.And(
        Expression.Header("In-Reply-To", "MessageId"),
        Expression.From("from@example.com));

You can find more on searching IMAP in .NET here:
https://www.limilabs.com/blog/how-to-search-imap-in-net

by (301k points)
...