Email.Smtp
1.0.0
dotnet add package Email.Smtp --version 1.0.0
NuGet\Install-Package Email.Smtp -Version 1.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="Email.Smtp" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Email.Smtp" Version="1.0.0" />
<PackageReference Include="Email.Smtp" />
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 Email.Smtp --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Email.Smtp, 1.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 Email.Smtp@1.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=Email.Smtp&version=1.0.0
#tool nuget:?package=Email.Smtp&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Email.Smtp
SMTP email service using MailKit with code-based HTML templates. Compatible with Mailpit (dev), Postal (self-hosted), or any standard SMTP server.
Features
- MailKit-based SMTP sending (replaces deprecated System.Net.Mail.SmtpClient)
- Code-based HTML email templates (embedded resources)
{{Placeholder}}template rendering with caching- SSL/TLS support for production SMTP servers
- Optional authentication (skip for Mailpit in dev)
Templates Included
| Template | Placeholders |
|---|---|
otp-code |
AppName, Code, ExpiryMinutes |
welcome |
AppName, UserName, TenantName, DashboardUrl |
password-reset |
AppName, ResetUrl, ExpiryMinutes |
payment-receipt |
AppName, PlanName, Amount, Date, InvoiceNumber |
payment-failed |
AppName, PlanName, Amount, BillingUrl |
account-deletion |
AppName |
Usage
// In Program.cs or DI setup
builder.Services.AddSmtpEmail(options =>
builder.Configuration.GetSection("Smtp").Bind(options));
// In appsettings.json
{
"Smtp": {
"Host": "mailpit", // or "postal.yourdomain.com"
"Port": 1025, // or 587 for TLS
"UseSsl": false,
"FromAddress": "noreply@localhost",
"FromName": "SaaS Platform"
}
}
// Send a templated email
var result = await emailService.SendTemplatedAsync(
EmailTemplateNames.OtpCode,
new EmailRecipient { Address = "user@example.com" },
"Your Verification Code",
new Dictionary<string, string>
{
["AppName"] = "My SaaS",
["Code"] = "123456",
["ExpiryMinutes"] = "5"
});
| 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
- Email.Abstractions (>= 1.0.0)
- Identity.Abstractions (>= 1.0.1)
- MailKit (>= 4.15.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 76 | 3/15/2026 |