![]() |
VOOZH | about |
dotnet add package batteries.Email --version 1.0.26
NuGet\Install-Package batteries.Email -Version 1.0.26
<PackageReference Include="batteries.Email" Version="1.0.26" />
<PackageVersion Include="batteries.Email" Version="1.0.26" />Directory.Packages.props
<PackageReference Include="batteries.Email" />Project file
paket add batteries.Email --version 1.0.26
#r "nuget: batteries.Email, 1.0.26"
#:package batteries.Email@1.0.26
#addin nuget:?package=batteries.Email&version=1.0.26Install as a Cake Addin
#tool nuget:?package=batteries.Email&version=1.0.26Install as a Cake Tool
This package contains a useful email service based on MailKit.
The message bus manager can be used for managing multiple instances of message bus on different locations.
Here is how to use it:
Add the setting binding
builder.Services.AddOptions<SmtpSettings>()
.BindConfiguration("MailSettings")
.ValidateDataAnnotations()
.ValidateOnStart();
builder.Services.AddSingleton(resolver => resolver.GetRequiredService<IOptions<SmtpSettings>>().Value);
Adapt your appsettings.json
and include the necessary settings: <small>(remember some provider like gmail enforce the usage of app passwords)</small>
"MailSettings": {
"SmtpServer": "smtp.gmail.com",
"Port": 465,
"Username": "my-fancy-gmail-account@gmail.com",
"Password": "xxxx xxxx xxxx xxxx",
"SenderAddress": "no-reply@no-mail.com",
"SenderName": "Fancy Service",
"UseSsl": true,
}
Add the background service
builder.Services.AddSingleton<IEmailSender, SmtpEmailService>();
Inject the service (for example in one controller)
public class DataController : ControllerBase
{
private readonly ILogger<DataController> logger;
private readonly IEmailSender sender;
public DataController(ILogger<DataController> logger, IEmailSender sender)
{
this.logger = logger;
this.sender = sender;
}
}
Follow this guide or the official guide for granting mailbox permission to a service principal.
todo
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.26 | 66 | 6/11/2026 |
| 1.0.25 | 186 | 4/2/2026 |
| 1.0.24 | 579 | 11/20/2025 |
| 1.0.23 | 241 | 11/1/2025 |
| 1.0.22 | 202 | 10/31/2025 |
| 1.0.21 | 226 | 10/30/2025 |
| 1.0.20 | 303 | 6/2/2025 |
| 1.0.19 | 214 | 6/2/2025 |
| 1.0.18 | 199 | 5/24/2025 |
| 1.0.17 | 325 | 5/13/2025 |
| 1.0.16 | 315 | 5/13/2025 |
| 1.0.15 | 186 | 1/30/2025 |
| 1.0.14 | 176 | 1/26/2025 |
| 1.0.13 | 177 | 1/25/2025 |