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()
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();
}
}