I don't think you can build such expression.
Expression.To("address1")
will match all email that are sent to address1, but will also match all email send to address1 and address2.
You can of course exclude address2:
Expression.And(
Expression.To("address1"),
Expression.Not(Expression.To("address2")))
but I don't think there is a way to match one and only one address.
Those expressions works for Gmail but not for Outlook :
- HasHeader Expression : Expression.HasHeader("In-Reply-To")
- Not expression : Expression.Not(Expression.From("hotmail"))
- Header Expression
Expression.HasHeader("In-Reply-To")
In-Reply-To header is specified in replies, so the receiver can find the original email.
Expression.Not(Expression.From("hotmail"))
Excludes all email sent from addresses or names that contain "hotmail" string.
Expression.Header("header1", "value1")
Matches all emails that have "header1" header and it contains "value1" string
If any of theses don't work in Outlook.com it is Outlook.com's bug.
Mail.dll only sends a query to the server. It is the server that is responsible to perform actual search.
I've just check and:
Expression.HasHeader - doesn't work
Expression.Header - works correctly (whole word match only, case insensitive)
Expression.Not - doesn't work