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

New Post: Not being Able to download messgaes from gmail

$
0
0
I have been trying for hours here when i execute the function below all get is "Object reference not set to an instance of an object" error, where am i going wrong?

public void imapx()
    {
        var client = new ImapClient("imap.gmail.com", true);
        if (client.Connect())
        {
            client.Login("username", "password");
            client.Behavior.MessageFetchMode = MessageFetchMode.Full;
            client.Behavior.AutoPopulateFolderMessages = true;
            var inbox = client.Folders.Inbox.Messages;
            inbox.Download();
        }

    }

Viewing all articles
Browse latest Browse all 1952


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