2
Vote

message id returns null

description

Hello,

I am trying to get message id but its value return is null.

var client = new ImapClient("imap.mail.com", 143, false);
        if (client.Connect())
        {
            if (client.Login("sername, password)))
            {

                var inbox = client.Folders.Inbox;
                var message = inbox.Search();
                foreach(var msg in message)
                {
                    Console.WriteLine("{0}",msg.MessageId);
                }
Please help.

comments

jevachka wrote Nov 1, 2016 at 7:23 AM

I'm having the same issue. I'm trying to read emails from gmail.com.
MessageId property return null and there is no "Message-ID" header in message.Headers.
How can i fix this problem?

fontan wrote Mar 7 at 12:39 PM

have you tried adding
   client.Behavior.RequestedHeaders = null;
into you code? ImapX now gets only few basic headers by default (I would suggest MessageID to be among them but it is not).