tags:

views:

7171

answers:

3

Is there a built-in method to access an Imap server (with SSL) in C# or is there a good free library?

+2  A: 

I haven't tried it myself, but this is a free library you could try (I not so sure about the SSL part on this one):

http://www.codeproject.com/KB/IP/imaplibrary.aspx

Also, there is xemail, which has parameters for SSL:

http://xemail-net.sourceforge.net/

[EDIT] If you (or the client) have the money for a professional mail-client, this thread has some good recommendations:

http://stackoverflow.com/questions/86553/working-with-pop-imap-email-and-net

Espo
the Imaplibrary at codeproject is what I was using but it does not have the needed functionality Ill checkout xemail
Unkwntech
+10  A: 

One more IMAP library for .NET, Freeware + Gmail support + Save messages like Drafts, more here :

http://hellowebapps.com/products/imapx/

Mehal
+1  A: 

There is no .NET framework support for IMAP. You'll need to use some 3rd party component.

Try http://www.lesnikowski.com/mail/, it's very affordable and easy to use, it also supports SSL:

using(Imap imap = new Imap())
{
    imap.ConnectSSL("imap.company.com");
    imap.Login("user", "password");

    imap.SelectInbox();
    List<long> uids = imap.SearchFlag(Flag.Unseen);
    foreach (long uid in uids)
    {
        string eml = imap.GetMessageByUID(uid);
        IMail message = new MailBuilder()
            .CreateFromEml(eml);

        Console.WriteLine(message.Subject);
        Console.WriteLine(message.TextDataString);
    }
    imap.Close(true);
}

Please note that this is a commercial product I've created.

You can download it here: http://www.lesnikowski.com/mail/.

Pawel Lesnikowski
works lovely, thank you !
balexandre