I'm continuing the tests on your API...
The environment is the same:
- Visual Studio 2013.
- Windows 8.1.
- Nokia Lumia 520.
First case: try to download unread e-mail from Gmail in a console application using the example on your web site. I'm using the "Mail.dll" version 3.0.15091.1036, runtime version v2.0.50727. Here the code:
using (Imap imap = new Imap())
{
imap.ConnectSSL("imap.gmail.com");
imap.UseBestLogin("myUsername", "myPassword");
imap.SelectInbox();
List<long> uids = imap.Search(Flag.Unseen);
foreach (long uid in uids)
{
var eml = imap.GetMessageByUID(uid);
IMail mail = new MailBuilder().CreateFromEml(eml);
Console.WriteLine(mail.Subject);
Console.WriteLine(mail.Text);
}
imap.Close();
}
Console.ReadKey();
}
The test goes perfectly!!!
Second case: try to download unread e-mail from Gmail in a Windows Phone 8.1 app (project: Visual C# -> Store Apps -> Windows Phone Apps). I'm using the "MailForWindowsStore.dll" version 3.0.14345.1944, runtime versione v4.0.30319. Here the code:
using (Imap imap = new Imap())
{
await imap.ConnectSSL("imap.gmail.com");
await imap.UseBestLoginAsync("myUsername", "myPassword");
await imap.SelectInboxAsync();
List<long> uids= await imap.SearchAsync(Flag.Unseen);
foreach (long uid in uids)
{
var eml = await imap.GetMessageByUIDAsync(uid);
IMail mail = new MailBuilder().CreateFromEml(eml);
}
await imap.CloseAsync();
}
Systems return my an NullreferenceException on "await imap.ConnectSSL("imap.gmail.com");"; here the call stack:
at Limilabs.Client.IMAP.ImapResponse..ctor(String tag)