When I Pull Mail, how do I know whether a mail is Answered for Exchange, IndexBox.Search(SearchQuery.Answered)
and IndexBox.Fetch(uid,MessageSummaryItems.Flags)
can not get Replied to Mail?
Asked
Active
Viewed 183 times
-1

SurvivalMachine
- 7,946
- 15
- 57
- 87

user6777454
- 19
- 3
1 Answers
0
I'm not entirely sure what you are asking because it seems to me that you've answered your own question.
folder.Search (SearchQuery.Answered)
This will return the UniqueIds of the messages that you have replied to.
folder.Fetch (..., MessageSummaryItems.Flags)
This will return a list of message summary records that will have the Flags field populated. You could then iterate over the list to find which messages had the Answered flag set.
If your question is not about how to know which messages have been replied to, but instead you are asking how to get the reply message, there is no IMAP command specifically for doing that.
What you would have to do is Fetch() the Envelope for the original message in order to get its Message-Id value and then you could try:
folder.Search (SearchQuery.HeaderContains ("References", msgid).Or (SearchQuery.HeaderContains ("In-Reply-To", msgid)));
Hope that helps.

jstedfast
- 35,744
- 5
- 97
- 110
-
thank you for your help! My question is how to know which messages have been replied to, when I use folder.Search (SearchQuery.Answered) Or folder.Fetch (..., MessageSummaryItems.Flags), the results about Flags is always MessageFlags.Recent|MessageFlags.Seen or MessageFlags.Seen or MessageFlags.Flagged, the server I use is OutLook 2013 (Exchange), when I use 163 server is Work fine, Forgive My poor English, thinks! – user6777454 Sep 05 '16 at 05:40
-
All of the results returned by searching for Answered are messages that have been replied to. All if the messages returned by Fetch() with summary.Flags.HasFlag (MessageFlags.Answered) have been replied to. – jstedfast Sep 07 '16 at 21:56