MailKit 5.0.0

Prefix Reserved

Requires NuGet 2.12 or higher.

dotnet add package MailKit --version 5.0.0
                    
NuGet\Install-Package MailKit -Version 5.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MailKit" Version="5.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MailKit" Version="5.0.0" />
                    
Directory.Packages.props
<PackageReference Include="MailKit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MailKit --version 5.0.0
                    
#r "nuget: MailKit, 5.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MailKit@5.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MailKit&version=5.0.0
                    
Install as a Cake Addin
#tool nuget:?package=MailKit&version=5.0.0
                    
Install as a Cake Tool

MailKit

Package Latest Release Latest Build
MimeKit MimeKit NuGetMimeKit NuGet Downloads MimeKit MyGet
MimeKit.Core MimeKit.Core NuGetMimeKit.Core NuGet Downloads MimeKit.Core MyGet
MimeKit.Cryptography MimeKit.Cryptography NuGetMimeKit.Cryptography NuGet Downloads MimeKit.Cryptography MyGet
MailKit MailKit NuGetMailKit NuGet Downloads MailKit MyGet
Platform Build Status Code Coverage Static Analysis
Linux/Mac Build Status Code Coverage Static Analysis
Windows Build Status Code Coverage Static Analysis

Obsolete Packages: | Package |Latest Release| |:----------|:------------:| |MimeKitLite|MimeKitLite NuGetMimeKit NuGet Downloads| |MailKitLite|MailKitLite NuGetMailKitLite NuGet Downloads|

What is MailKit?

MailKit is a cross-platform mail client library built on top of MimeKit.

Supported platforms: .NET 8.0 and later, .NET Framework 4.6.2 and later, and any platform that implements .NET Standard 2.0 or 2.1 (such as Mono, .NET MAUI and Unity).

Upgrading from MailKit 4.x? MailKit 5.0 contains a number of breaking changes. See the Porting Guide for step-by-step migration instructions and the Release Notes for the complete list of changes.

Contents

MailKit is a personal open source project that I have put thousands of hours into perfecting with the goal of making it the very best email framework for .NET. I need your help to achieve this.

Donating helps pay for things such as web hosting, domain registration and licenses for developer tools such as a performance profiler, memory profiler, a static code analysis tool, and more. It also helps motivate me to continue working on the project.

<a href="https://github.com/sponsors/jstedfast" _target="blank"><img alt="Click here to lend your support to MailKit by making a donation!" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif"></a>

Features

Goals

The main goal of this project is to provide the .NET world with robust, fully featured and RFC-compliant SMTP, POP3, and IMAP client implementations.

All of the other .NET IMAP client implementations that I could find suffer from major architectural problems such as ignoring unexpected untagged responses, assuming that literal string tokens will never be used for anything other than message bodies (when in fact they could be used for pretty much any string token in a response), assuming that the way to find the end of a message body in a FETCH response is by scanning for ") UID", and not properly handling mailbox names with international characters to simply name a few.

IMAP requires a LOT of time spent laboriously reading and re-reading the IMAP specifications (as well as the MIME specifications) to understand all of the subtleties of the protocol and most (all?) of the other Open Source .NET IMAP libraries, at least, were written by developers that only cared enough that it worked for their simple needs. There's nothing necessarily wrong with doing that, but the web is full of half-working, non-RFC-compliant IMAP implementations out there that it was finally time for a carefully designed and implemented IMAP client library to be written.

For POP3, libraries such as OpenPOP.NET are actually fairly decent, although the MIME parser is far too strict - throwing exceptions any time it encounters a Content-Type or Content-Disposition parameter that it doesn't already know about, which, if you read over the mailing-list, is a problem that OpenPOP.NET users are constantly running into. MailKit's Pop3Client, of course, doesn't have this problem. It also parses messages directly from the socket instead of downloading the message into a large string buffer before parsing it, so you'll probably find that not only is MailKit faster (MailKit's MIME parser, MimeKit, parses messages from disk 25x faster than OpenPOP.NET's parser), but also uses far less memory.

For SMTP, most developers use System.Net.Mail.SmtpClient which suits their needs more-or-less satisfactorily and so is probably not high on their list of needs. However, the SmtpClient implementation included with MailKit is a much better option if cross-platform support is needed or if the developer wants to be able to save and re-load MIME messages before sending them via SMTP. MailKit's SmtpClient also supports PIPELINING which should improve performance of sending messages (although might not be very noticeable).

License Information

MIT License

Copyright (C) 2013-2026 .NET Foundation and Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Installing via NuGet

The easiest way to install MailKit is via NuGet:

dotnet add package MailKit

Or, in Visual Studio's Package Manager Console:

Install-Package MailKit

MailKit depends on MimeKit.Core, which provides MIME parsing and message construction.

Cryptography Support (S/MIME, OpenPGP, DKIM and ARC)

MailKit itself does not need any cryptography packages, but if you want to sign, encrypt, decrypt or verify messages using S/MIME, OpenPGP, DKIM or ARC, you will also need to add a reference to MimeKit.Cryptography (or to the MimeKit meta-package, which references both MimeKit.Core and MimeKit.Cryptography):

dotnet add package MimeKit.Cryptography

Then initialize MimeKit's cryptography support once at startup, before using any of those features:

using MimeKit.Cryptography;

CryptographyModule.Initialize ();

For more information, see MimeKit's documentation on using its cryptography support.

Getting the Source Code

MailKit includes MimeKit as a git submodule, so make sure to clone recursively:

git clone --recursive https://github.com/jstedfast/MailKit.git

To update an existing clone later:

git pull
git submodule update --init --recursive

Building

MailKit requires the .NET 10.0 SDK (or later) to build. The .NET 8.0 runtime is also required to run the unit tests.

In the top-level MailKit directory, there are a number of solution files; they are:

  • MailKit.sln - includes the projects for .NET Framework 4.6.2/4.7/4.8, .NETStandard 2.0/2.1, .NET 8.0/10.0 as well as the unit tests.
  • MailKit.Coverity.sln - this is used to generate Coverity static analysis builds and is not generally useful.
  • MailKit.Documentation.sln - this is used to generate the documentation found at https://mimekit.net/docs and requires Sandcastle Help File Builder.

To build from the command-line, run the following commands in the top-level MailKit directory:

dotnet build MailKit.sln -c Release
dotnet test UnitTests/UnitTests.csproj -c Release

Alternatively, you can open MailKit.sln in Visual Studio 2026 (or later), choose the Debug or Release build configuration and then build.

Note: The Release build will generate the xml API documentation, but the Debug build will not.

Package smoke tests

Run pwsh -File scripts\test-packages.ps1 on Windows to build and pack MailKit, MimeKit.Core and MimeKit.Cryptography, then test fresh consumers outside the checkout. This requires PowerShell 7, NuGet CLI, the .NET 10 SDK, .NET 8/10 runtimes and the platform's Native AOT prerequisites. Initialize the MimeKit submodule before running it. If Windows Native AOT tool discovery fails, ensure the Visual Studio Installer directory (containing vswhere.exe) is on PATH.

The script checks package contents, compiles all seven supported frameworks, runs MIME and loopback SMTP probes on .NET 8/10, verifies S/MIME signing and module registration, and publishes/runs a package-based Native AOT probe. Restores use fresh caches and source mapping; MailKit and MimeKit must come from the local packages, and the core dependency graph must not include BouncyCastle. No packages are published, no external mail server is used, and no certificates are installed.

Use -KeepArtifacts to retain the packages and consumers (failures retain them automatically). To test the same packages on Linux, copy the retained feed directory and run the script from the matching checkout with -PackageDirectory <feed-directory> on a host with the required SDK, runtimes and AOT toolchain. -DependencySource <url> selects a NuGet mirror for third-party dependencies. -SkipCryptography and -SkipAot explicitly omit those checks for a partial run.

Using MailKit

Every MailKit API that performs network I/O has both a synchronous and an asynchronous (*Async) variant. The samples below use the async APIs, which are recommended for most applications (especially UI and server applications), but the synchronous APIs work the same way.

Connecting Securely

The Connect and ConnectAsync methods take a SecureSocketOptions value that controls how SSL/TLS is used:

Option Description Typical Ports
SslOnConnect Use SSL/TLS immediately upon connecting. SMTP: 465, POP3: 995, IMAP: 993
StartTls Connect in plain text, then upgrade the connection using STARTTLS (fails if the server doesn't support it). SMTP: 587, POP3: 110, IMAP: 143
StartTlsWhenAvailable Like StartTls, but continues unencrypted if the server doesn't support STARTTLS. Not recommended. SMTP: 25/587, POP3: 110, IMAP: 143
Auto Choose SslOnConnect or StartTlsWhenAvailable based on the port. Any
None No SSL/TLS. Not recommended. Any
await client.ConnectAsync ("smtp.friends.com", 587, SecureSocketOptions.StartTls);

By default, MailKit rejects server certificates that fail validation. If you need to customize this (for example, to trust a self-signed certificate used by your own server), set the client's ServerCertificateValidationCallback property before connecting. Please don't simply return true, as that disables protection against man-in-the-middle attacks. See the FAQ for more details.

Authenticating with OAuth2

Many mail providers, including Microsoft 365/Exchange Online and GMail, require (or strongly encourage) OAuth2 instead of passwords. Once you have obtained an access token for the user, authenticate using SaslMechanismOAuth2:

using MailKit.Security;

var oauth2 = new SaslMechanismOAuth2 (emailAddress, accessToken);

await client.AuthenticateAsync (oauth2);

For step-by-step instructions on obtaining an access token, see:

Logging and Diagnostics

When something isn't working, the first thing to look at is the protocol log. Pass a ProtocolLogger to the client's constructor to record the conversation between the client and the server:

using var client = new SmtpClient (new ProtocolLogger ("smtp.log"));

Authentication secrets are redacted from the log by default, which makes it safe to include in bug reports.

On .NET 8.0 and later, MailKit also supports metrics and tracing via System.Diagnostics, so it integrates with OpenTelemetry. Call Telemetry.SmtpClient.Configure () (or the equivalent for Socket, Pop3Client or ImapClient) to enable the meters. For a list of the available metrics and activities, see Telemetry.md.

Sending Messages

One of the more common operations that MailKit is meant for is sending email messages.

using System;
using System.Threading.Tasks;

using MailKit.Net.Smtp;
using MailKit.Security;
using MailKit;
using MimeKit;

namespace TestClient {
    class Program
    {
        public static async Task Main (string[] args)
        {
            var message = new MimeMessage ();
            message.From.Add (new MailboxAddress ("Joey Tribbiani", "joey@friends.com"));
            message.To.Add (new MailboxAddress ("Mrs. Chanandler Bong", "chandler@friends.com"));
            message.Subject = "How you doin'?";

            message.Body = new TextPart ("plain") {
                Text = @"Hey Chandler,

I just wanted to let you know that Monica and I were going to go play some paintball, you in?

-- Joey"
            };

            using (var client = new SmtpClient ()) {
                await client.ConnectAsync ("smtp.friends.com", 587, SecureSocketOptions.StartTls);

                // Note: only needed if the SMTP server requires authentication
                await client.AuthenticateAsync ("joey", "password");

                var result = await client.SendAsync (message);
                Console.WriteLine ("The server accepted the message: {0}", result.ResponseText);

                await client.DisconnectAsync (true);
            }
        }
    }
}

SendAsync () returns a SendResult that contains the server's response along with the lists of accepted and rejected recipients.

By default, SmtpClient throws an SmtpCommandException if the server rejects any of the recipients. To deliver the message to the remaining recipients instead, use an SmtpSendRequest that overrides OnRecipientNotAccepted ():

class LenientSendRequest : SmtpSendRequest
{
    public LenientSendRequest (MimeMessage message) : base (message)
    {
    }

    public override void OnRecipientNotAccepted (MailboxAddress recipient, SmtpResponse response)
    {
        // Don't throw; the recipient will be listed in SendResult.RejectedRecipients instead.
    }
}

// ...

var result = await client.SendAsync (new LenientSendRequest (message));

foreach (var recipient in result.RejectedRecipients)
    Console.WriteLine ("Rejected: {0}", recipient);

SmtpSendRequest is also how you request per-message SMTP options such as delivery status notifications (DSN).

Retrieving Messages (via Pop3)

One of the other main uses of MailKit is retrieving messages from pop3 servers.

using System;
using System.Threading.Tasks;

using MailKit.Net.Pop3;
using MailKit.Security;
using MailKit;
using MimeKit;

namespace TestClient {
    class Program
    {
        public static async Task Main (string[] args)
        {
            using (var client = new Pop3Client ()) {
                await client.ConnectAsync ("pop.friends.com", 995, SecureSocketOptions.SslOnConnect);

                await client.AuthenticateAsync ("joey", "password");

                for (int i = 0; i < client.Count; i++) {
                    var message = await client.GetMessageAsync (i);
                    Console.WriteLine ("Subject: {0}", message.Subject);
                }

                await client.DisconnectAsync (true);
            }
        }
    }
}

Using IMAP

More important than POP3 support is the IMAP support. Here's a simple use-case of retrieving messages from an IMAP server:

using System;
using System.Threading.Tasks;

using MimeKit;
using MailKit;
using MailKit.Search;
using MailKit.Security;
using MailKit.Net.Imap;

namespace TestClient {
    class Program
    {
        public static async Task Main (string[] args)
        {
            using (var client = new ImapClient ()) {
                await client.ConnectAsync ("imap.friends.com", 993, SecureSocketOptions.SslOnConnect);

                await client.AuthenticateAsync ("joey", "password");

                // The Inbox folder is always available on all IMAP servers...
                var inbox = client.Inbox;
                await inbox.OpenAsync (FolderAccess.ReadOnly);

                Console.WriteLine ("Total messages: {0}", inbox.Count);
                Console.WriteLine ("Recent messages: {0}", inbox.Recent);

                for (int i = 0; i < inbox.Count; i++) {
                    var message = await inbox.GetMessageAsync (i);
                    Console.WriteLine ("Subject: {0}", message.Subject);
                }

                await client.DisconnectAsync (true);
            }
        }
    }
}

Fetching Information About the Messages in an IMAP Folder

One of the advantages of IMAP over POP3 is that the IMAP protocol allows clients to retrieve information about the messages in a folder without having to first download all of them.

Using the Fetch and FetchAsync method overloads (or the convenient extension methods), it's possible to obtain any subset of summary information for any range of messages in a given folder.

foreach (var summary in await inbox.FetchAsync (0, -1, MessageSummaryItems.Envelope)) {
    Console.WriteLine ("[summary] {0:D2}: {1}", summary.Index, summary.Envelope.Subject);
}

It's also possible to use Fetch/FetchAsync APIs that take an IFetchRequest argument to get even more control over what to fetch:

// Let's Fetch non-Received headers:
var request = new FetchRequest {
    Headers = new HeaderSet (new HeaderId[] { HeaderId.Received }) {
        Exclude = true
    }
};

foreach (var summary in await inbox.FetchAsync (0, -1, request)) {
    Console.WriteLine ("[summary] {0:D2}: {1}", summary.Index, summary.Headers[HeaderId.Subject]);
}

The results of a Fetch method can also be used to download individual MIME parts rather than downloading the entire message. For example:

foreach (var summary in await inbox.FetchAsync (0, -1, MessageSummaryItems.UniqueId | MessageSummaryItems.BodyStructure)) {
    if (summary.TextBody != null) {
        // this will download *just* the text/plain part
        var text = await inbox.GetBodyPartAsync (summary.UniqueId, summary.TextBody);
    }

    if (summary.HtmlBody != null) {
        // this will download *just* the text/html part
        var html = await inbox.GetBodyPartAsync (summary.UniqueId, summary.HtmlBody);
    }

    // if you'd rather grab, say, an image attachment... it might look something like this:
    if (summary.Body is BodyPartMultipart) {
        var multipart = (BodyPartMultipart) summary.Body;

        var attachment = multipart.BodyParts.OfType<BodyPartBasic> ().FirstOrDefault (x => x.FileName == "logo.jpg");
        if (attachment != null) {
            // this will download *just* the attachment
            var part = await inbox.GetBodyPartAsync (summary.UniqueId, attachment);
        }
    }
}

Setting Message Flags in IMAP

In order to set or update the flags on a particular message, what is actually needed is the UID or index of the message and the folder that it belongs to.

An obvious reason to want to update message flags is to mark a message as "read" (aka "seen") after a user has opened a message and read it.

await folder.StoreAsync (uid, new StoreFlagsRequest (StoreAction.Add, MessageFlags.Seen) { Silent = true });

Deleting Messages in IMAP

Deleting messages in IMAP involves setting a \Deleted flag on a message and, optionally, expunging it from the folder.

The way to mark a message as \Deleted works the same way as marking a message as \Seen.

await folder.StoreAsync (uid, new StoreFlagsRequest (StoreAction.Add, MessageFlags.Deleted) { Silent = true });
await folder.ExpungeAsync ();

Searching an IMAP Folder

You may also be interested in sorting and searching...

// let's search for all messages received after Jan 12, 2013 with "MailKit" in the subject...
var query = SearchQuery.DeliveredAfter (DateTime.Parse ("2013-01-12"))
    .And (SearchQuery.SubjectContains ("MailKit")).And (SearchQuery.Seen);

foreach (var uid in await inbox.SearchAsync (query)) {
    var message = await inbox.GetMessageAsync (uid);
    Console.WriteLine ("[match] {0}: {1}", uid, message.Subject);
}

// let's do the same search, but this time sort them in reverse arrival order
var orderBy = new [] { OrderBy.ReverseArrival };
foreach (var uid in await inbox.SortAsync (query, orderBy)) {
    var message = await inbox.GetMessageAsync (uid);
    Console.WriteLine ("[match] {0}: {1}", uid, message.Subject);
}

// you'll notice that the orderBy argument is an array... this is because you
// can actually sort the search results based on multiple columns:
orderBy = new [] { OrderBy.ReverseArrival, OrderBy.Subject };
foreach (var uid in await inbox.SortAsync (query, orderBy)) {
    var message = await inbox.GetMessageAsync (uid);
    Console.WriteLine ("[match] {0}: {1}", uid, message.Subject);
}

Of course, instead of downloading the message, you could also fetch the summary information for the matching messages or do any of a number of other things with the UIDs that are returned.

How about navigating folders? MailKit can do that, too:

// Get the first personal namespace and list the toplevel folders under it.
var personal = client.GetFolder (client.PersonalNamespaces[0]);
foreach (var folder in await personal.GetSubfoldersAsync (false))
    Console.WriteLine ("[folder] {0}", folder.Name);

If the IMAP server supports the SPECIAL-USE or the XLIST (GMail) extension, you can get a hold of the pre-defined All, Drafts, Flagged (aka Important), Junk, Sent, Trash, etc folders like this:

if (client.Capabilities.Contains (ImapCapability.SpecialUse) || client.Capabilities.Contains (ImapCapability.XList)) {
    var drafts = client.GetFolder (SpecialFolder.Drafts);
} else {
    // maybe check the user's preferences for the Drafts folder?
}

In cases where the IMAP server does not support the SPECIAL-USE or XLIST extensions, you'll have to come up with your own heuristics for getting the Sent, Drafts, Trash, etc folders. For example, you might use logic similar to this:

static string[] CommonSentFolderNames = { "Sent Items", "Sent Mail", "Sent Messages", /* maybe add some translated names */ };

static async Task<IMailFolder?> GetSentFolderAsync (ImapClient client, CancellationToken cancellationToken)
{
    var personal = client.GetFolder (client.PersonalNamespaces[0]);

    foreach (var folder in await personal.GetSubfoldersAsync (false, cancellationToken)) {
        foreach (var name in CommonSentFolderNames) {
            if (folder.Name == name)
                return folder;
        }
    }

    return null;
}

Using LINQ, you could simplify this down to something more like this:

static string[] CommonSentFolderNames = { "Sent Items", "Sent Mail", "Sent Messages", /* maybe add some translated names */ };

static async Task<IMailFolder?> GetSentFolderAsync (ImapClient client, CancellationToken cancellationToken)
{
    var personal = client.GetFolder (client.PersonalNamespaces[0]);

    var folders = await personal.GetSubfoldersAsync (false, cancellationToken);

    return folders.FirstOrDefault (x => CommonSentFolderNames.Contains (x.Name));
}

Another option might be to allow the user of your application to configure which folder he or she wants to use as their Sent folder, Drafts folder, Trash folder, etc.

How you handle this is up to you.

Monitoring an IMAP Folder for Changes

To be notified when new messages arrive (or when messages are deleted or their flags change), use an ImapIdleSession. It uses the IDLE command when the server supports it (restarting it periodically so that the connection isn't dropped) and falls back to polling with NOOP when the server doesn't:

await client.Inbox.OpenAsync (FolderAccess.ReadOnly);

var session = client.CreateIdleSession ();

// Cancel the token to stop monitoring; the IDLE command is ended gracefully and the client remains usable.
try {
    await foreach (var changes in session.ReadChangesAsync (cancellationToken)) {
        if (changes.MessagesArrived)
            Console.WriteLine ("New messages have arrived! The Inbox now has {0} messages.", client.Inbox.Count);
    }
} catch (OperationCanceledException) {
}

The IDLE command has already been ended by the time each batch of changes is returned, so it is safe to issue other commands (such as fetching the new messages) while processing them. For a more complete example, see ImapIdleSessionExample.cs.

Contributing

The first thing you'll need to do is fork MailKit to your own GitHub repository. For instructions on how to clone it, see the section titled Getting the Source Code.

MailKit uses an .editorconfig file to describe its coding style (tabs for indentation and a space before the opening parenthesis of method calls and declarations), which is supported by Visual Studio, Visual Studio Code, Rider and most other editors. Please try to follow the existing coding style as best as you can.

Once you've got some changes that you'd like to submit upstream to the official MailKit repository, send me a Pull Request and I will try to review your changes in a timely manner.

If you'd like to contribute but don't have any particular features in mind to work on, check out the issue tracker and look for something that might pique your interest!

Reporting Bugs

Have a bug or a feature request? Please open a new bug report or feature request.

Before opening a new issue, please search through any existing issues to avoid submitting duplicates. It may also be worth checking the FAQ for common questions that other developers have had.

If MailKit does not work with your mail server, please include a protocol log in your bug report, otherwise there is nothing I can do to fix the problem.

If you are getting an exception from somewhere within MailKit, don't just provide the Exception.Message string. Please include the Exception.StackTrace as well. The Message, by itself, is often useless.

Documentation

API documentation can be found at https://www.mimekit.net/docs.

Some example snippets can be found in the Documentation/Examples directory.

Sample applications can be found in the samples directory.

A copy of the XML-formatted API reference documentation is also included in the NuGet package.

Further Reading

.NET Foundation

MailKit is a .NET Foundation project.

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the .NET Foundation Code of Conduct.

General .NET OSS discussions: .NET Foundation forums

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 is compatible.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1.7K)

Showing the top 5 NuGet packages that depend on MailKit:

Package Downloads
Umbraco.Cms.Web.Common

Contains the web assembly needed to run Umbraco CMS.

Umbraco.Cms.Infrastructure

Contains the infrastructure assembly needed to run Umbraco CMS.

Umbraco.Cms.Examine.Lucene

Adds Examine searching support using Lucene to Umbraco CMS.

Umbraco.Cms.Web.Website

Contains the website assembly needed to run the frontend of Umbraco CMS.

DH.MailKit

用于DH框架的邮件操作类库

GitHub repositories (163)

Showing the top 20 popular GitHub repositories that depend on MailKit:

Repository Stars
bitwarden/server
Bitwarden infrastructure/backend (API, database, Docker, etc).
ardalis/CleanArchitecture
Clean Architecture Solution Template: A proven Clean Architecture Template for ASP.NET Core 10
babalae/better-genshin-impact
📦BetterGI · 更好的原神 - 自动拾取 | 自动剧情 | 全自动钓鱼(AI) | 全自动七圣召唤 | 自动伐木 | 自动刷本 | 自动采集/挖矿/锄地 | 一条龙 | 全连音游 | 自动烹饪 | 桌面分身 - UI Automation Testing Tools For Genshin Impact
Sonarr/Sonarr
Smart PVR for newsgroup and bittorrent users.
duplicati/duplicati
Store securely encrypted backups in the cloud!
Radarr/Radarr
Movie organizer/manager for usenet and torrent users.
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
Kareadita/Kavita
Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.
aspnetboilerplate/aspnetboilerplate
ASP.NET Boilerplate - Web Application Framework
dodyg/practical-aspnetcore
Practical samples of ASP.NET Core 11, 10, 9, 8.0, 7.0, 6.0, 5.0, 3.1, 2.2, and 2.1,projects you can use. Readme contains explanations on all projects.
nopSolutions/nopCommerce
ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
OrchardCMS/OrchardCore
Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
btcpayserver/btcpayserver
Accept Bitcoin payments. Free, open-source & self-hosted, Bitcoin payment processor.
Prowlarr/Prowlarr
Prowlarr is an indexer manager/proxy built on the popular *arr .net/reactjs base stack to integrate with your various PVR apps, supporting management of both Torrent Trackers and Usenet Indexers.
fullstackhero/dotnet-starter-kit
Production Grade Cloud-Ready .NET 10 Starter Kit (Web API + React Client) with Multitenancy Support, and Clean/Modular Architecture that saves roughly 200+ Development Hours! All Batteries Included.
win-acme/win-acme
Automate SSL/TLS certificates on Windows with ease
Lidarr/Lidarr
Looks and smells like Sonarr but made for music.
umbraco/Umbraco-CMS
Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
immense/Remotely
A remote control and remote scripting solution, built with .NET 8, Blazor, and SignalR.
simplcommerce/SimplCommerce
A simple, cross platform, modulith ecommerce system built on .NET
Version Downloads Last Updated
5.0.0 0 11/10/2026
4.18.2 1,274,313 10/23/2026
4.18.1 3,744,941 9/27/2026
4.18.0 1,610,670 9/13/2026
4.17.0 16,040,336 5/26/2026
4.16.0 17,794,652 4/15/2026
4.15.1 4,521,160 3/5/2026 4.15.1 has at least one vulnerability with moderate severity.
4.15.0 1,138,678 2/15/2026 4.15.0 has at least one vulnerability with moderate severity.
4.14.1 8,200,825 10/13/2025 4.14.1 has at least one vulnerability with moderate severity.
4.14.0 1,692,629 9/28/2025 4.14.0 has at least one vulnerability with moderate severity.
4.13.0 6,381,638 6/25/2025 4.13.0 has at least one vulnerability with moderate severity.
4.12.1 3,170,356 5/17/2025 4.12.1 has at least one vulnerability with moderate severity.
4.12.0 2,137,309 4/29/2025 4.12.0 has at least one vulnerability with moderate severity.
4.11.0 5,881,676 3/9/2025 4.11.0 has at least one vulnerability with moderate severity.
4.10.0 4,411,667 1/26/2025 4.10.0 has at least one vulnerability with moderate severity.
4.9.0 5,241,701 12/10/2024 4.9.0 has at least one vulnerability with moderate severity.
4.8.0 12,196,820 9/29/2024 4.8.0 has at least one vulnerability with moderate severity.
4.7.1.1 10,386,944 7/15/2024 4.7.1.1 has at least one vulnerability with moderate severity.
4.7.1 1,127,250 7/12/2024 4.7.1 has at least one vulnerability with moderate severity.
4.7.0 1,087,545 6/29/2024 4.7.0 has at least one vulnerability with moderate severity.
Loading failed

MailKit 5.0 is a major release containing a number of breaking changes. See https://github.com/jstedfast/MailKit/blob/master/ReleaseNotes.md for the complete list of changes and https://github.com/jstedfast/MailKit/blob/master/PortingGuide.md for migration notes.

* MailKit now depends on MimeKit.Core instead of MimeKit and no longer depends on BouncyCastle. S/MIME, OpenPGP, DKIM and ARC support requires the MimeKit.Cryptography package and a call to CryptographyModule.Initialize (). MailKitLite has been retired; use MailKit instead.
* Send () and SendAsync () now return a SendResult (with AcceptedRecipients and RejectedRecipients) instead of a string. Per-message SMTP options such as DSN are now configured via SmtpSendRequest.
* The ImapCapabilities, SmtpCapabilities and Pop3Capabilities flag enums have been replaced by read-only capability sets keyed by the ImapCapability, SmtpCapability and Pop3Capability enums.
* Message sizes, folder sizes and quota limits are now 64-bit (long) values.
* Added ImapIdleSession (via ImapClient.CreateIdleSession ()) to simplify monitoring a folder for changes.