A cross-platform .NET library for IMAP, POP3 and SMTP
open sourceMITfree
MailKit is a cross-platform mail client library for .NET, built on the MimeKit MIME parser by the same author. It has SMTP, POP3 and IMAP4 clients with SSL/TLS and STARTTLS, client certificates, SASL authentication (SCRAM, NTLM, OAUTHBEARER, XOAUTH2 and the rest, for OAuth2 sign-in to Gmail and Microsoft 365), SOCKS and HTTP proxies, and async, cancellable APIs. Its IMAP client searches, fetches, flags and moves messages, navigates folders and watches a folder for changes with IDLE. It runs on .NET 8 and later, .NET Framework 4.6.2 and later and .NET Standard 2.0 platforms such as Mono, .NET MAUI and Unity. A .NET Foundation project, MIT licensed.
Problems it solves
- send email over SMTP from a .NET app
- read a mailbox over IMAP in C#
- sign in to Gmail or Outlook with OAuth2 from a .NET mail client
- replace the obsolete System.Net.Mail SmtpClient
Features
- SMTP client with DSN, PIPELINING, CHUNKING and SMTPUTF8
- POP3 client
- IMAP4 client with search, flags, folders and IDLE
- SASL authentication including SCRAM, NTLM, OAUTHBEARER and XOAUTH2
- SOCKS4/4a, SOCKS5 and HTTP proxies
- SSL/TLS, STARTTLS and client certificates
- Async and cancellable APIs
- Built on MimeKit for parsing and building messages, with S/MIME, OpenPGP and DKIM
