Mail.dll - IMAP .NET component
Enhance your .NET applications in C# and VB.NET with the powerful IMAP .NET client component integrated into Mail.dll's email toolkit.
Seamlessly receive and process emails using the IMAP protocol, with support for signature verification and decryption. Our IMAP client is crafted entirely in managed code, ensuring optimal performance.
Compatible with a wide range of frameworks, including .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. Upgrade your email functionality with ease and efficiency using Mail.dll's IMAP client component.
Features
- UNIQUE Robust IMAP client plus POP3 and SMTP clients in a single library.
- IMAP protocol allows getting most common email data fast
- UNIQUE Email component includes most reliable MIME parser on the market
- Fully compatible with all IMAP servers:
Microsoft Exchange, Office 365, Gmail, Dovecot, hMailServer and others - IMAP SSL/TLS support
- TLS 1.2 support
- Automatic email attachment encoding/decoding
- S/MIME: IMAP received signed emails validation, IMAP received emails decryption
- UNIQUE Received DKIM emails validation
- UNIQUE iCalendar appointments and vCard support
- TNEF support (decodes winmail.dat files)
- Proxy support: IMAP over HTTP and Socks proxy (Socks5, Socks4, Socks4a)
- IMAP IDLE: push email support for IMAP client
- UNIQUE IMAP OAuth 2.0 for web sites (ASP.NET) and IMAP OAuth 2.0 for installed applications support
- UNIQUE Supports Gmail extensions for IMAP
- Bounce handling for emails received with IMAP
- Bayesian spam filter (over 99.5% accuracy)
- UNIQUE Build-in HTML email to plain text email converter
What folks are saying about IMAP in Mail.dll
I wanted to drop a short note to you to say hi, just bought a license, and thanks for writing and publishing what is so far the best IMAP tool I’ve found. And I’ve installed 4 or so other components from other vendors.
First let me say: great piece of work. I ordered a license of Mail.dll for fetching Mails via IMAP last week.
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