Mail.dll - .NET email component (IMAP, POP3, S/MIME)
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 and .NET 7.0.
Features
- IMAP client for receiving emails, POP3 client for receiving emails, SMTP client for sending emails in a single package
- UNIQUE Email component includes most reliable MIME parser on the market
- UNIQUE Covered with 5,500+ unit and integration tests
- Fully compatible with Microsoft Exchange (all versions), Office 365, Gmail, Dovecot, hMailServer and others
- IMAP SSL/TLS, SMTP SSL/TLS, POP3 SSL/TLS are all supported
- TLS 1.2 support
- Automatic email attachment encoding/decoding
- S/MIME: sending signed emails, sending encrypted emails
- S/MIME: received signed emails validation, received emails decryption
- UNIQUE Received emails DKIM validation and signing
- UNIQUE iCalendar appointments and vCard support
- Easy Outlook .msg files processing and .msg to MIME converter
- TNEF support (decodes winmail.dat files)
- Create attachments from a file or byte array
- Secure login (APOP, CRAM-MD5, DIGEST-MD5 support)
- Proxy support: HTTP and Socks proxy (Socks5, Socks4, Socks4a)
- IMAP IDLE: push email support for IMAP client
- UNIQUE Template engine support
- Support for displaying emails in Windows applications
- UNIQUE OAuth 2.0 for web sites (ASP.NET) and OAuth 2.0 for installed applications support
- UNIQUE IMAP protocol Gmail extensions
- Bounce handlingfor emails received with IMAP and POP3
- Bayesian spam filter (over 99.5% accuracy)
- UNIQUE Build-in HTML email to plain text email converter
What folks are saying about Mail.dll
Just bought a license. Mail.dll is an absolutely fantastic email library. I would recommend it to anyone who needs to send or receive emails from .NET applications
I like your product. I should also recognize the excellent technical support you provide; my questions were always promptly answered, and the answers were very helpful every time.
I’ve installed 4 or so other email components from other vendors, played with each of them to see how easy they are to work with, and yours was up and running quicker, easier, and better than all the others.
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.
-
Receive emails using IMAP with C# .NET client
using(Imap imap = new Imap()) { imap.ConnectSSL("imap.server.com"); // or Connect for non SSL/TLS imap.UseBestLogin("user", "password"); imap.SelectInbox(); List<long> uids = imap.Search(Flag.Unseen); foreach (long uid in uids) { IMail email = new MailBuilder() .CreateFromEml(imap.GetMessageByUID(uid)); string subject = mail.Subject; } imap.Close(); }
-
Receive emails using POP3 with C# .NET client
-
Send emails using SMTP with C# .NET client
-
Receive emails using POP3 with VB.NET client
Using imap As New Imap imap.ConnectSSL("imap.server.com") ' or Connect for non SSL/TLS imap.UseBestLogin("user", "password") imap.SelectInbox() Dim uidList As List(Of Long) = imap.Search(Flag.Unseen) For Each uid As Long In uidList Dim email As IMail = New MailBuilder() _ .CreateFromEml(imap.GetMessageByUID(uid)) Dim subject As String = email.Subject Next imap.Close() End Using
-
Receive emails using POP3 with VB.NET client
-
Send emails using SMTP with VB.NET client