SU2.C15e.Infrastructure.Email 2.4.1-rc.1

This is a prerelease version of SU2.C15e.Infrastructure.Email.
dotnet add package SU2.C15e.Infrastructure.Email --version 2.4.1-rc.1
                    
NuGet\Install-Package SU2.C15e.Infrastructure.Email -Version 2.4.1-rc.1
                    
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="SU2.C15e.Infrastructure.Email" Version="2.4.1-rc.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SU2.C15e.Infrastructure.Email" Version="2.4.1-rc.1" />
                    
Directory.Packages.props
<PackageReference Include="SU2.C15e.Infrastructure.Email" />
                    
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 SU2.C15e.Infrastructure.Email --version 2.4.1-rc.1
                    
#r "nuget: SU2.C15e.Infrastructure.Email, 2.4.1-rc.1"
                    
#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 SU2.C15e.Infrastructure.Email@2.4.1-rc.1
                    
#: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=SU2.C15e.Infrastructure.Email&version=2.4.1-rc.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=SU2.C15e.Infrastructure.Email&version=2.4.1-rc.1&prerelease
                    
Install as a Cake Tool

SU2.C15e.Infrastructure.Email

SMTP adapter opt-in cho IEmailSender của SU2.C15e.Core.Interfaces. Worker chỉ cần package này, không cần SU2.C15e.Web.Defaults hoặc ASP.NET Core.

Đăng ký

using SU2.C15e.Infrastructure.Email;

builder.Services.AddMimeKitEmailSender(builder.Configuration);

Extension bind section Mailserver, validate options khi khởi động và đăng ký sender/pool dạng Singleton. Chỉ tham chiếu package không tự bật gửi thư.

Sender/pool dùng IOptionsMonitor<MailserverConfiguration>, không dùng IOptionsSnapshot (Scoped, không inject trực tiếp vào Singleton). Sender đọc CurrentValue; pool theo dõi OnChange để không tái sử dụng kết nối thuộc cấu hình cũ. Reload cần configuration provider hỗ trợ thông báo thay đổi; thay ENV không tự cập nhật process đang chạy. MaxConnections đọc khi tạo pool nên thay đổi cần restart. Custom ISmtpOAuth2TokenProvider phải phù hợp Singleton pool, không giữ dependency Scoped trực tiếp.

{
  "Mailserver": {
    "Hostname": "smtp.example.com",
    "Port": 587,
    "Security": "StartTls",
    "Authentication": "Basic",
    "Username": "service-account",
    "DefaultFromAddress": "noreply@example.com",
    "MaxConnections": 4
  }
}

Truyền Mailserver:Password qua secret store/environment, không lưu mật khẩu trong source. OAuth2 dùng ISmtpOAuth2TokenProvider do service cung cấp.

Hành vi

  • SendEmailAsync(to, from, subject, body) giữ API cũ; SendAsync(EmailMessage, CancellationToken) hỗ trợ HTML, To/Cc/Bcc/ReplyTo, attachment, inline resource và custom header.
  • await hoàn thành khi SMTP server đã nhận thư; không phải queue/outbox hoặc bảo đảm giao tới hộp thư.
  • Pool giới hạn số kết nối đồng thời; retry lỗi tạm thời có thể gửi trùng nếu server nhận thư trước khi kết nối bị ngắt. Consumer cần lưu ý semantics at-least-once.
  • Giữ namespace SU2.C15e.Infrastructure.Email; Web.Defaults forward public types tới leaf.
  • Binary gọi constructor cũ dùng IOptionsSnapshot<MailserverConfiguration> phải biên dịch lại và chuyển sang DI extension; type forwarding không khôi phục constructor đã đổi.

Dependency và bảo mật

Package phụ thuộc Core, MailKit và Microsoft.Extensions cần thiết; không phụ thuộc Web/Common. MimeKit kéo System.Security.Cryptography.Pkcs gián tiếp. Release này chưa xử lý cảnh báo NuGet của dependency đó; không coi việc không gọi PKCS trực tiếp là chứng minh an toàn.

Product 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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SU2.C15e.Infrastructure.Email:

Package Downloads
SU2.C15e.Web.Defaults

Clean Architecture template — batteries-included default host bundle for SU2.Web. Ships the AddServiceConfigs / AddOptionConfigs / AddMediatorSourceGen composition + UseAppMiddlewareAndSeedDatabase pipeline + Audit.NET HTTP middleware (UseAuditHttpMiddleware) + AddAuditHttpClient. References the meta SU2.Infrastructure so a host gets the full kitchen-sink in one reference. Lean consumers reference SU2.Web (core) + per-feature AddXxx() instead. Numeronym `C15e` = CleanArchitecture. Generation 2026 series.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.4.1-rc.1 0 10/16/2026
2.4.0-rc.1 0 10/16/2026