Fusonic.Extensions.Email 8.1.2

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

Email

Setup

The following sample binds settings from the configuration located in the section "Email" using SimpleInjector.

The settings contain sender Email and name, SMTP settings, Debug settings and CSS settings. Check the EmailSettings class for details.

container.RegisterEmail(options => Configuration.GetSection("Email").Bind(options));

Create and send an email

To add new emails, following steps need to be done:

  1. Add a new View (.cshtml) in the directory Views/Emails/.
  2. Add a new ViewModel in the same namespace as the business logic that needs to send the mail.
  3. Add the EmailView attribute to the ViewModel. The constructor argument is path to the view, relative to the Views directory without the .cshtml extension. Example: [EmailView("Emails/Registration")] points to Views/Emails/Registration.cshtml.
  4. Extend the EmailController with a new method to render the view file and return the contents.
  5. To send the mail in the business logic use the MediatR-command SendEmail and supply it with the view model. SendEmail renders the mail based on the view model and the EmailViewAttribute.

To check the visuals of the view file, use the Swagger API to access the methods of the EmailController.

View locations

The views that are used for the emails are configured on the EmailViewAttribute. To find the view, the Razor view engine looks in the folder Views by default. A view path of Emails/FancyEmail matches to Views/Emails/FancyEmail.cshtml.

If you want to place the Views in other folders, for example /Emails, you can simply configure this in the Razor options as follows:

services.Configure<RazorViewEngineOptions>(options => options.ViewLocationFormats.Add("/Emails/{0}" + RazorViewEngine.ViewExtension));

Attachments

By default, only attachments in file://-Uris are supported. To allow adding attachments from other sources (eg. AWS S3), implement IEmailAttachmentResolver and register it SimpleInjector with

container.Collections.Append<IEmailAttachmentResolver, YourResolver>()

Headers

No special Headers are sent per default, however with the Headers parameter on SendEmail, MimeKit.Headers can be added to the email (overrides all Headers defined in EmailOptions.DefaultHeaders). With EmailOptions.DefaultHeaders default headers can be set for all emails. Predefined sets of headers can be found in EmailHeaders:

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 was computed.  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 was computed.  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
10.0.0 279 11/25/2025
10.0.0-rc.2 151 11/24/2025
10.0.0-rc.1 129 9/12/2025
9.5.4 252 8/20/2025
9.5.3 295 3/28/2025
9.5.2 347 1/16/2025
9.5.0 346 10/4/2024
9.4.0 273 9/23/2024
9.3.1 329 9/11/2024
9.3.0 223 9/11/2024
9.2.0 253 8/8/2024
9.2.0-rc.3 91 8/7/2024
9.2.0-rc.2 76 8/5/2024
9.2.0-rc.1 94 8/1/2024
9.1.0 198 7/29/2024
9.0.0 846 7/17/2024
9.0.0-preview.2 140 6/13/2024
9.0.0-preview.1 108 4/5/2024
8.1.3 349 3/27/2024
8.1.2 233 3/27/2024
8.1.1 229 3/1/2024
8.1.0 1,303 1/26/2024
8.0.1 294 12/18/2023
8.0.1-rc.2 136 12/7/2023
8.0.1-rc.1 114 12/6/2023
8.0.0 316 11/21/2023
8.0.0-preview1 166 10/4/2023
7.4.0 252 1/25/2024
7.3.0 266 10/11/2023
7.2.1-rc.1 186 8/28/2023
7.2.0 477 6/28/2023
7.2.0-alpha.1 184 6/27/2023
7.1.2 614 5/25/2023
7.1.1 1,047 4/3/2023
7.1.1-rc.2 210 3/30/2023
7.1.1-rc.1 177 3/30/2023
7.1.0 974 2/28/2023
7.1.0-rc.1 191 2/20/2023
7.0.4-rc.5 195 2/23/2023
7.0.4-rc.4 219 2/23/2023
7.0.4-rc.3 191 2/23/2023
7.0.4-rc.2 188 2/22/2023
7.0.4-rc.1 194 2/16/2023
7.0.3 536 2/16/2023
7.0.2 396 2/9/2023
7.0.2-rc.1 231 2/2/2023
7.0.1 727 1/26/2023
7.0.0 620 1/24/2023
7.0.0-preview1 289 7/18/2022
7.0.0-beta.9 211 1/24/2023
7.0.0-beta.8 192 1/23/2023
7.0.0-beta.7 220 1/23/2023
7.0.0-beta.6 234 1/23/2023
7.0.0-beta.5 212 1/23/2023
7.0.0-beta.4 224 1/19/2023
7.0.0-beta.3 202 1/17/2023
7.0.0-beta.2 202 1/11/2023
7.0.0-beta.1 193 11/24/2022
6.2.2 1,409 9/20/2022
6.2.2-rc.1 224 9/19/2022
6.2.1 2,108 5/4/2022
6.2.0 611 4/21/2022
6.2.0-rc.2 277 4/21/2022
6.2.0-rc.1 278 4/20/2022
6.1.1 1,150 3/1/2022
6.1.0 814 2/10/2022
6.1.0-rc.3 254 2/10/2022
6.1.0-rc.2 243 2/10/2022
6.1.0-rc.1 245 2/9/2022
6.0.3 1,563 1/18/2022
6.0.2 930 1/10/2022
6.0.1 495 12/16/2021
6.0.0 839 12/13/2021
6.0.0-rc.6 309 12/6/2021
6.0.0-rc.5 471 12/6/2021
6.0.0-rc.4 637 12/6/2021
6.0.0-rc.3 492 12/6/2021
6.0.0-rc.2 470 12/6/2021
6.0.0-rc.1 770 11/15/2021
5.4.0 829 10/13/2021
5.3.0 512 9/23/2021
5.3.0-rc.1 470 9/17/2021
5.2.0 2,823 5/20/2021
5.2.0-rcjh.6 354 5/19/2021
5.2.0-rcjh.5 280 5/19/2021
5.2.0-rcjh.4 330 5/19/2021
5.2.0-rcjh.3 282 5/19/2021
5.2.0-rcjh.2 280 4/12/2021
5.2.0-rcjh.1 272 4/12/2021
5.1.3 545 5/19/2021
5.1.2 804 3/26/2021
5.1.1 1,162 1/13/2021
5.1.0 2,160 12/16/2020
5.0.0 897 11/17/2020
5.0.0-rc.1 437 10/15/2020
2.0.6 1,661 10/8/2020
2.0.5 1,382 8/19/2020
2.0.4 2,606 7/10/2020
2.0.3 700 7/10/2020
2.0.2 704 7/9/2020
2.0.1 704 7/9/2020
2.0.0 723 6/17/2020
1.0.0 752 6/15/2020