Build an app that sends automated emails via SMTP with OAuth2 authentication for Gmail or Outlook.
Create a background service that monitors an IMAP mailbox and processes incoming messages without blocking the main thread.
Add email attachment handling with S/MIME or PGP encryption to a web application.
Sync emails from a POP3 server in a desktop client using cancellable async calls.
MailKit is a C# library for .NET that gives applications the ability to send and receive email. It handles three standard email protocols: SMTP for sending mail, IMAP for reading and managing mail on a server, and POP3 for downloading mail from a server. The library runs on Windows, macOS, and Linux, and is built on top of a companion library called MimeKit, which handles the structure of email messages, including attachments, HTML bodies, plain text parts, digital signatures, and encryption via S/MIME and PGP. The library covers a wide range of authentication methods, so it works with mail servers that require anything from simple username and password login to OAuth2 tokens used by Gmail, Outlook, and other modern providers. Connections can also be routed through HTTP or SOCKS proxies for environments where direct server access is not possible. For developers, every operation can be cancelled mid-flight, and each action has both a regular version and an asynchronous version that does not block the calling thread while waiting for the mail server to respond. This makes it suitable for desktop apps, web backends, and background services. The IMAP client supports a large number of server extensions, which means it can take advantage of features like server-side sorting, folder sharing, push notifications for new mail, and efficient incremental sync on servers that offer them. The SMTP and POP3 clients similarly handle connection encryption, extension negotiation, and multiple authentication schemes automatically. MailKit is available as a NuGet package and can be added to a project in a single step. Lighter-weight editions of both MailKit and MimeKit are also published for projects that do not need the full feature set.
← jstedfast on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.