Find threads containing single message.Ĭonsole.WriteLine("Gmail message id: ", _Įnvelope.GmailMessageId, envelope.Subject) If (threads.ContainsKey(threadId) = false) List envelopes = client.GetEnvelopeByUID(uids) ĭecimal threadId = (decimal) envelope.GmailThreadId I have tried using a number of tools and plugins, but the one that worked the best is DragApp. Thankfully, there are various tools and plugins out there that can come in handy. Searching and segregating your mails manually will take forever. Using(Imap client = new "app-password") ĬommonFolders common = new CommonFolders(folders) A Gmail account can get cluttered and it can get hard to filter the account. It contains thread id to which this email was assigned to by Gmail.įinally we’ll find threads that contain only one message – those are messages that were not answered. Envelope contains GmailThreadId property. Then we’ll get Envelope for each message. We’ll connect to Gmail using IMAP – remember to use SSL and be sure to enable IMAP protocol for Gmail.Īs we plan to search all emails, including sent and received ones, we’ll use CommonFolders class to get ‘All Mail’ folder. One option to resolve this problem is to use Gmail IMAP extensions, X-GM-THRID in particular. This means that \Answered flag can’t be used to find not-answered emails. It will only be set if the messages were answered using an email program that sets this flag. Unfortunately if the message is answered through Gmail’s web interface, the \Answered flag will not be set. This flag can by set by client applications or even by SMTP server, which can be examining In-Reply-To email headers. \Answered flag should mark messages that have been answered.
IMAP protocol in RFC3501 introduced \Answered flag.