It seems you are missing invocation of Imap.ConnectSSL. Here's the code that shows how to connect to Gmail IMAP server:
using(Imap imap = new Imap())
{
imap.ConnectSSL("imap.gmail.com");
imap.UseBestLogin("pat@gmail.com", "password");
imap.SelectInbox();
List<long> uids = imap.Search(Flag.Unseen);
foreach (long uid in uids)
{
IMail email = new MailBuilder()
.CreateFromEml(imap.GetMessageByUID(uid));
Console.WriteLine(email.Subject);
}
imap.Close();
}
MailForWindowsStore.dll
If you are using MailForWindowsStore.dll, then ConnectSSL method is async - you must await it:
using(Imap imap = new Imap())
{
await imap.ConnectSSL("imap.gmail.com");
await imap.UseBestLogin("pat@gmail.com", "password");