Quantcast
Channel: ImapX 2
Viewing all articles
Browse latest Browse all 1952

New Post: Error Getting Messages.Count() Object reference not set to an instance of an object.

$
0
0
Hi there guys im having problemas getting the count of the messages of the infox heres is my code:
  ImapClient client = new ImapClient("imap.gmail.com", 993, true, true);
        bool connect = client.Connect();
        client.Login("12345@gmail.com", "passwordhere");
        client.Behavior.AutoPopulateFolderMessages = true;
  

        Button1.Text = client.Folders.Inbox.Messages.Count().ToString();
I get the error: Object reference not set to an instance of an object.
In that line but the log in and all that is OK


I hope you guys can help me

Thanks

Viewing all articles
Browse latest Browse all 1952

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>