Athenex.Whimclean.Infrastructure.Email.Smtp
2.0.0
Prefix Reserved
dotnet add package Athenex.Whimclean.Infrastructure.Email.Smtp --version 2.0.0
NuGet\Install-Package Athenex.Whimclean.Infrastructure.Email.Smtp -Version 2.0.0
<PackageReference Include="Athenex.Whimclean.Infrastructure.Email.Smtp" Version="2.0.0" />
<PackageVersion Include="Athenex.Whimclean.Infrastructure.Email.Smtp" Version="2.0.0" />
<PackageReference Include="Athenex.Whimclean.Infrastructure.Email.Smtp" />
paket add Athenex.Whimclean.Infrastructure.Email.Smtp --version 2.0.0
#r "nuget: Athenex.Whimclean.Infrastructure.Email.Smtp, 2.0.0"
#:package Athenex.Whimclean.Infrastructure.Email.Smtp@2.0.0
#addin nuget:?package=Athenex.Whimclean.Infrastructure.Email.Smtp&version=2.0.0
#tool nuget:?package=Athenex.Whimclean.Infrastructure.Email.Smtp&version=2.0.0
Athenex.Whimclean.Infrastructure.Email.Smtp
SMTP implementation of IEmailSender from Athenex.Whimclean.Application, over System.Net.Mail.
Install
dotnet add package Athenex.Whimclean.Infrastructure.Email.Smtp
Register
using Athenex.Whimclean.Infrastructure.Email.Smtp;
services.AddSmtpEmailSender(options =>
{
options.Host = "smtp.example.com";
options.Port = 587;
options.From = "noreply@example.com";
options.FromName = "Example";
options.User = "smtp-user";
options.Password = configuration["Email:Password"];
});
In an ASP.NET Core host, bind and validate the options from the Email section instead and call the registration without a delegate:
using Athenex.Whimclean.Api.AspNetCore.Configuration;
using Athenex.Whimclean.Infrastructure.Email.Smtp;
services.AddValidatedOptions<SmtpEmailOptions>(configuration, SmtpEmailOptions.SectionName, options => options.Validate());
services.AddSmtpEmailSender();
SmtpEmailOptions holds Host, Port (default 587), From, FromName, User, Password, EnableSsl (default true) and TimeoutSeconds (default 30). With the delegate the options are validated when first used; with AddValidatedOptions they are validated at startup. Validate() fails with a message naming the setting when Host or From is missing, Port is not a valid TCP port, or TimeoutSeconds is not positive.
Behavior
- A message with both bodies is sent as plain text with an HTML alternate view; a single body is sent as is.
Fromon the message overrides the configured sender;ReplyTo, CC, BCC and attachments map directly, attachments keeping their declared content type.EnableSslnegotiates STARTTLS and is on by default; credentials are sent only whenUseris set. A newSmtpClientwith the configured timeout is created per send.- The sender is registered with
TryAddScoped, so an application-suppliedIEmailSenderwins.
Repository and full architecture guide: https://github.com/athene-x/Whimclean
| 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. |
-
net10.0
- Athenex.Whimclean.Application (>= 2.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.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 |
|---|---|---|
| 2.0.0 | 103 | 11/17/2026 |
First release: SMTP email sender and options.