Search code examples
c#.netgmailimapx

it is possible get email list using imapX?


I downloaded the ImapX library and I need know it is possible get email list using imapx? if not, what is the best quick and fast way to do it? the google API looks like a bit confusing. and I need it to winforms application.


Solution

  • The sample provided on the ImapX site is pretty clear :

    var client = new ImapX.ImapClient("imap.gmail.com", 993, true);
    client.Connection();
    client.LogIn(userName, userPassword);
    var messages = client.Folders["INBOX"].Search("ALL", true);
    

    So, the answer to your question is: Yes!

    I haven't used ImapX, so I cannot confirm that this code is working. Personnaly, I prefer MailSystem.NET which seems to be more complete (it's not limited to IMAP) but lacks documentation.