message-id Questions - Rebex Q&A Forum (C#, VB.NET)most recent 30 from http://forum.rebex.net2010-09-08T14:39:33Zhttp://forum.rebex.net/feeds/tag/message-idhttp://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://forum.rebex.net/questions/96/retrieving-the-message-idRetrieving the Message-IDWakatake2010-03-07T14:11:32Z2010-08-27T01:23:57Z
<p>Hello,</p>
<p>How do I parse the Message-ID from the headers?</p>
<p>I have the following:</p>
<pre><code>static void Main(string[] args)
{
Imap imap = new Imap();
imap.Connect("imap.gmail.com", 993, null, ImapSecurity.Implicit);
imap.Login(username, password);
imap.SelectFolder("Inbox");
ImapMessageCollection collection = imap.GetMessageList(ImapListFields.FullHeaders);
foreach (ImapMessageInfo msg in collection)
{
Console.WriteLine(msg.MessageId.Id);
}
Console.Read();
}
</code></pre>
<p>but I am having a NullReferenceException. How do I go about it, the correct way? Thanks!</p>