RCommon.Emailing 2.4.1

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package RCommon.Emailing --version 2.4.1
                    
NuGet\Install-Package RCommon.Emailing -Version 2.4.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="RCommon.Emailing" Version="2.4.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RCommon.Emailing" Version="2.4.1" />
                    
Directory.Packages.props
<PackageReference Include="RCommon.Emailing" />
                    
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 RCommon.Emailing --version 2.4.1
                    
#r "nuget: RCommon.Emailing, 2.4.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 RCommon.Emailing@2.4.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=RCommon.Emailing&version=2.4.1
                    
Install as a Cake Addin
#tool nuget:?package=RCommon.Emailing&version=2.4.1
                    
Install as a Cake Tool

RCommon.Emailing

An email service abstraction for .NET with a built-in SMTP implementation, designed to integrate with the RCommon dependency injection builder pattern.

Features

  • IEmailService abstraction for sending email via System.Net.Mail.MailMessage
  • Synchronous and asynchronous send methods
  • Built-in SMTP implementation (SmtpEmailService) using System.Net.Mail.SmtpClient
  • Configurable SMTP settings including host, port, SSL, credentials, and default sender
  • EmailSent event for post-send notifications
  • Fluent DI registration through the AddRCommon() builder

Installation

dotnet add package RCommon.Emailing

Usage

using RCommon;

services.AddRCommon()
    .WithSmtpEmailServices(settings =>
    {
        settings.Host = "smtp.example.com";
        settings.Port = 587;
        settings.EnableSsl = true;
        settings.UserName = "user@example.com";
        settings.Password = "password";
        settings.FromEmailDefault = "noreply@example.com";
        settings.FromNameDefault = "My Application";
    });

Then inject and use IEmailService:

using RCommon.Emailing;
using System.Net.Mail;

public class NotificationService
{
    private readonly IEmailService _emailService;

    public NotificationService(IEmailService emailService)
    {
        _emailService = emailService;
    }

    public async Task SendWelcomeEmailAsync(string toAddress)
    {
        var message = new MailMessage("noreply@example.com", toAddress)
        {
            Subject = "Welcome!",
            Body = "<h1>Welcome to our app</h1>",
            IsBodyHtml = true
        };

        await _emailService.SendEmailAsync(message);
    }
}

Key Types

Type Description
IEmailService Abstraction for sending email with sync and async methods
SmtpEmailService SMTP-based implementation using System.Net.Mail.SmtpClient
SmtpEmailSettings Configuration for SMTP host, port, SSL, credentials, and default sender
EmailEventArgs Event args carrying the MailMessage after a successful send
EmailingBuilderExtensions Provides WithSmtpEmailServices() for the RCommon builder

Documentation

For full documentation, visit rcommon.com.

License

Licensed under the Apache License, Version 2.0.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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 (2)

Showing the top 2 NuGet packages that depend on RCommon.Emailing:

Package Downloads
RCommon.SendGrid

A cohesive set of infrastructure libraries for dotnet that utilizes abstractions for event handling, persistence, unit of work, mediator, distributed messaging, event bus, CQRS, email, and more

RCommon.Emailing.SendGrid

A cohesive set of .NET 7 infrastructure libraries that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.4.2-alpha.0.5 0 3/24/2026
2.4.2-alpha.0.1 0 3/24/2026
2.4.1 109 2/18/2026
2.3.2-alpha.0.3 51 2/18/2026
2.3.2-alpha.0.2 47 2/18/2026
2.3.2-alpha.0.1 56 2/9/2026
2.3.1 172 2/5/2026
2.3.0 112 2/3/2026
2.2.2-alpha.0.1 395 12/11/2025
2.2.1-alpha.0.2 140 10/24/2025
2.2.1-alpha.0.1 137 10/24/2025
2.1.11-alpha.0.2 141 10/24/2025
2.1.11-alpha.0.1 111 7/18/2025
2.1.10 295 7/17/2025
2.1.9-alpha.0.1 153 7/17/2025
2.1.2.4 237 5/21/2025
2.1.2.3 234 5/1/2025
2.1.2.2 493 1/23/2025
2.1.2.1 163 1/17/2025
0.0.0-alpha.0 146 7/17/2025
Loading failed