VOOZH about

URL: https://www.nuget.org/packages/batteries.Email/

⇱ NuGet Gallery | batteries.Email 1.0.26




👁 Image
batteries.Email 1.0.26

dotnet add package batteries.Email --version 1.0.26
 
 
NuGet\Install-Package batteries.Email -Version 1.0.26
 
 
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="batteries.Email" Version="1.0.26" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="batteries.Email" Version="1.0.26" />
 
Directory.Packages.props
<PackageReference Include="batteries.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 batteries.Email --version 1.0.26
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: batteries.Email, 1.0.26"
 
 
#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 batteries.Email@1.0.26
 
 
#: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=batteries.Email&version=1.0.26
 
Install as a Cake Addin
#tool nuget:?package=batteries.Email&version=1.0.26
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

batteries.Email 👁 logo

👁 NuGet Version

Description

This package contains a useful email service based on MailKit.

Usage

The message bus manager can be used for managing multiple instances of message bus on different locations.

Here is how to use it:

  1. Add the setting binding

    builder.Services.AddOptions<SmtpSettings>()
    .BindConfiguration("MailSettings")
    .ValidateDataAnnotations()
    .ValidateOnStart();
    builder.Services.AddSingleton(resolver => resolver.GetRequiredService<IOptions<SmtpSettings>>().Value);
    
    
  2. 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,
    }
    
  3. Add the background service

    builder.Services.AddSingleton<IEmailSender, SmtpEmailService>();
    
  4. 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;
     }
    }
    

OAuth2 and Microsoft Office 356

Preparation:

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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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