IMAP component and POP3 component that allows to receive emails and process emails in .NET applications, in C# and VB.NET. Includes SMTP component for sending emails, along with signing emails and encrypting emails. Supports signature verification and decryption for received emails. Written entirely in managed code. Works with .NET 2.0-4.7.2, .NET 4.8, Mono, .NET Core 2.0+, .NET Standard 2.0+, .NET 5.0, .NET 6.0, .NET 7.0, and .NET 8.0.

Features

What folks are saying about Mail.dll

Quick start .NET samples

Receive emails using IMAP in .NET

    using(Imap imap = new Imap())
    {
        imap.ConnectSSL("imap.server.com");
        imap.UseBestLogin("user", "pass");
    
        imap.SelectInbox();

        List<long> uids = imap.Search(
            Flag.Unseen);
        long first = uids[0];
        
        byte[] eml = imap
            .GetMessageByUID(first);
        
        IMail email = new MailBuilder()
            .CreateFromEml(eml);
        
        string subject = email.Subject;
        
        imap.Close();
    }
    

Receive emails using POP3 in .NET

    using(Pop3 pop3 = new Pop3())
    {
        pop3.ConnectSSL("imap.server.com");
        pop3.UseBestLogin("user", "pass");
    
        List<long> uids = pop3.GetAll();
        long first = uids[0];
        
        byte[] eml = pop3
            .GetMessageByUID(first);
        
        IMail email = new MailBuilder()
            .CreateFromEml(eml);
        
        string subject = email.Subject;
        
        pop3.Close();
    }
    
You can find more samples here.

Our customers

Get Started Today