MyNet.Mail.MailKit
19.3.0
dotnet add package MyNet.Mail.MailKit --version 19.3.0
NuGet\Install-Package MyNet.Mail.MailKit -Version 19.3.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="MyNet.Mail.MailKit" Version="19.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MyNet.Mail.MailKit" Version="19.3.0" />
<PackageReference Include="MyNet.Mail.MailKit" />
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 MyNet.Mail.MailKit --version 19.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MyNet.Mail.MailKit, 19.3.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 MyNet.Mail.MailKit@19.3.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=MyNet.Mail.MailKit&version=19.3.0
#tool nuget:?package=MyNet.Mail.MailKit&version=19.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
<div align="center">
MyNet.Mail.MailKit
<img src="MyNetMail.png" alt="MyNet.Mail.MailKit" width="96" height="96" />
MailKit implementation of MyNet.Mail IMailService with TLS configuration, connection reuse, and Microsoft.Extensions.DependencyInjection registration.
</div>
<div align="center">
</div>
Features
| Feature | Description |
|---|---|
| MailKit | IMailService implementation for SMTP |
| TLS | Configuration and connection reuse |
| DI | AddMailKit() registration extensions |
| Production | Ready transport for MyNet.Mail models |
Installation
dotnet add package MyNet.Mail.MailKit
Quick start
using Microsoft.Extensions.DependencyInjection;
using MyNet.Mail;
using MyNet.Mail.MailKit;
using MyNet.Mail.Smtp;
var services = new ServiceCollection();
services.AddMailKitMailService();
// After BuildServiceProvider():
var factory = serviceProvider.GetRequiredService<IMailServiceFactory>();
await using var mail = factory.Create(new SmtpClientOptions
{
Server = "smtp.example.com",
Port = 587,
UseSsl = true,
RequiresAuthentication = true,
User = "user",
Password = "secret",
});
var email = Email.From("sender@example.com", "Sender")
.To("recipient@example.com")
.Subject("Hello")
.Body("<p>Hello from MyNet.</p>", isHtml: true);
var response = await mail.SendAsync(email);
Related packages
Documentation
<div align="center">
<sub>
Copyright © 2016-2026 - Stéphane ANDRE. All Rights Reserved.
<br/>
Released under the MIT License.
</sub>
</div>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- MailKit (>= 4.17.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 11.0.0-preview.4.26230.115)
- MyNet.Mail (>= 19.3.0)
- MyNet.Utilities (>= 19.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.