What would be the most efficent way to parse the raw headers of an email a specific field (list-unsubscribe or ThreadTopic/Index for expample) without first saving an EML/MSG to a file or db?
Thanks in advance
What would be the most efficent way to parse the raw headers of an email a specific field (list-unsubscribe or ThreadTopic/Index for expample) without first saving an EML/MSG to a file or db?
Thanks in advance
Hi,
Thanks for the reply Babar but unless I am missing something the ImapMessageInfoCollection doesnt contain the Raw headers. It appears to me that it only contains the unfolded message headers with the standard "To/From/CC/Subject/Date", etc. Here is a code snippet from what I believe you are talking about doing. And header information such as ThreadTopic/ThreadIndex and List-Unsubscribe are not contained in that collection (i dont believe).
int msgCount = this.imapClient.ListMessages().Count; if (msgCount > 0) { ImapMessageInfoCollection list = this.imapClient.ListMessages(); } else { this.imapClient.Disconnect(); return; }
Hi,
When you say “is unavailable at the moment by using ImapClient” does that mean that the funcionality is intended to be there but isnt or that it’s working as intended and look elsewhere? Do you have a work around?
Also tried to:
private void MessageHeader() { _client.SelectFolder(ImapFolderInfo.InBox); ImapMessageInfoCollection messages = _client.ListMessages(); foreach (ImapMessageInfo message in messages) { MailMessage msg = _client.FetchMessage(message.UniqueId); foreach (MimeHeader header in msg.Headers) { if (header.Name.Equals("ThreadTopic")) { string threadTopic = header.RawContent; } } } }
and received an exception of:
Unable to cast object of type 'System.String' to type 'Aspose.Email.Mime.MimeHeader'.
Hi,
Hi,