Pacem.Messaging.Email.Smtp 0.10.17

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

Email sending services implementation based on:

MailKit SmtpClient

About

Pacem.Messaging.Email.Smtp provides an implementation of IMessagingProvider that sends email messages using SMTP protocol.

Getting started

Inject the IMessagingProviderFactory singleton service into the DI container, then extend its capabilities adding SMTP implementation:


services.AddPacemMessaging()
	.WithSmtpClient(options => {
        // setup configuration
		options.Host = "smtp.office365.com";
        options.Username = "dnr@foo.com";
        options.From = "noreply@baz.net";
        options.Port = 587;
        options.Password = "password";
        options.UseSsl = true;
	});

You can then generate a new sending provider by using the dedicated extension method:


// dep injected factory instance
private readonly IMessagingProviderFactory _factory;
private readonly ILogger _logger;

async Task SomeMethodAsync(){

    var client = _factory.CreateSmtpClientEmailMessagingProvider();

	EmailMessage msg = new EmailMessage
    {
        Body = "<body>Hello, <b>World</b>!</body>",
        To = ["foo@baz.com"],
        ReplyTo = "foo@bar.com",
        DisplayFrom = "Tester",
        Subject = "Test Message",
    };

	var response = await client.SendMessageAsync(msg);
	_logger.LogInformation("Status {status}.", response.Status);
}

You can shortcut it by directly asking the DI for the the default configured IMessagingProvider<EmailMessage>:


// dep injected emailer instance
private readonly IMessagingProvider<EmailMessage> _emailer;
private readonly ILogger _logger;

async Task SomeMethodAsync(){

	EmailMessage msg = new EmailMessage
    {
        // omitted...
    };

	var response = await _emailer.SendMessageAsync(msg);
	_logger.LogInformation("Status {status}.", response.Status);
}

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

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
0.10.18-selberg 45 10/1/2026
0.10.18-riemann 83 9/26/2026
0.10.18-pascal 86 9/21/2026
0.10.17 89 9/18/2026
0.10.17-foucault 88 9/18/2026
0.10.16 83 9/16/2026
0.10.16-hamilton 78 9/14/2026
0.10.16-gauss 80 9/14/2026
0.10.16-faraday 94 9/9/2026
0.10.15 96 9/7/2026
0.10.15-euler 94 9/7/2026
0.10.14 97 9/6/2026
0.10.14-dedekind 106 9/6/2026
0.10.14-cauchy 96 9/5/2026
0.10.14-boltzmann 87 9/5/2026
0.10.13 110 9/3/2026
0.10.13-abel 90 9/3/2026
0.10.12 85 9/3/2026
0.10.11 100 8/26/2026
0.10.10 116 7/28/2026
Loading failed