Mail.dll 3.0.19029.1200

Mail.dll - .NET email component (IMAP, POP3, SMTP)

Mail.dll is a .NET IMAP component, POP3 component and SMTP component library. Includes an email and MIME parser. Allows sending, receiving and processing email messages in .NET applications. Includes SSL and TLS support along with OAuth and DKIM capabilities. Includes secure MIME (S/MIME) parser for processing encrypted and signed emails. Contains iCal, vCard and Outlook's msg files parsers. Decodes winmail.dat attachments.

There is a newer version of this package available.
See the version list below for details.
Install-Package Mail.dll -Version 3.0.19029.1200
dotnet add package Mail.dll --version 3.0.19029.1200
<PackageReference Include="Mail.dll" Version="3.0.19029.1200" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mail.dll --version 3.0.19029.1200
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Quick start samples

IMAP

using(Imap imap = new Imap())
{
       imap.Connect("imap.server.com");  // or ConnectSSL for SSL/TLS
       imap.UseBestLogin("user", "password");

       imap.SelectInbox();
       List<long> uids = imap.Search(Flag.Unseen);
       foreach (long uid in uids)
       {
           var eml = imap.GetMessageByUID(uid);

           IMail email = new MailBuilder().CreateFromEml(eml);

           Console.WriteLine(email.Subject);
       }
       imap.Close();
}

POP3

using(Pop3 pop3 = new Pop3())
{
    pop3.Connect("pop3.server.com");  // or ConnectSSL for SSL/TLS     
    pop3.UseBestLogin("user", "password");

    List<string> uids = pop3.GetAll();
    foreach (string uid in uids)
    {
        var eml = pop3.GetMessageByUID(uid);

        IMail email = new MailBuilder().CreateFromEml(eml);

        Console.WriteLine(email.Subject);
    }
    pop3.Close();
} 

Quick start samples

IMAP

using(Imap imap = new Imap())
{
       imap.Connect("imap.server.com");  // or ConnectSSL for SSL/TLS
       imap.UseBestLogin("user", "password");

       imap.SelectInbox();
       List<long> uids = imap.Search(Flag.Unseen);
       foreach (long uid in uids)
       {
           var eml = imap.GetMessageByUID(uid);

           IMail email = new MailBuilder().CreateFromEml(eml);

           Console.WriteLine(email.Subject);
       }
       imap.Close();
}

POP3

using(Pop3 pop3 = new Pop3())
{
    pop3.Connect("pop3.server.com");  // or ConnectSSL for SSL/TLS     
    pop3.UseBestLogin("user", "password");

    List<string> uids = pop3.GetAll();
    foreach (string uid in uids)
    {
        var eml = pop3.GetMessageByUID(uid);

        IMail email = new MailBuilder().CreateFromEml(eml);

        Console.WriteLine(email.Subject);
    }
    pop3.Close();
} 

Version History

Version Downloads Last updated
3.0.19134.1431 362 5/14/2019
3.0.19029.1200 7,438 2/1/2019
3.0.18307.847 16,979 11/3/2018
3.0.18201.1449 19,015 7/20/2018
3.0.18165.2350 7,360 6/14/2018
3.0.18151.1319 4,203 5/31/2018
3.0.18072.1009 7,185 3/13/2018
3.0.18026.1647 12,247 1/26/2018
3.0.17312.2008 22,598 11/8/2017