Ninjasoft.MailBuilder
1.1.0
dotnet add package Ninjasoft.MailBuilder --version 1.1.0
NuGet\Install-Package Ninjasoft.MailBuilder -Version 1.1.0
<PackageReference Include="Ninjasoft.MailBuilder" Version="1.1.0" />
<PackageVersion Include="Ninjasoft.MailBuilder" Version="1.1.0" />
<PackageReference Include="Ninjasoft.MailBuilder" />
paket add Ninjasoft.MailBuilder --version 1.1.0
#r "nuget: Ninjasoft.MailBuilder, 1.1.0"
#addin nuget:?package=Ninjasoft.MailBuilder&version=1.1.0
#tool nuget:?package=Ninjasoft.MailBuilder&version=1.1.0
Ninjasoft.MailBuilder
A utility to help build email in code
Purpose
The purpose of this project is to provide a utility to build email messages in code.
Usage
Start by creating a new instance of 'MailMessageBuilder' in the following way
var mailMessageBuilder = new MailMessageBuilder();
This is setup as a builder pattern so the variable name from above is not necessary if that is the route you are going down.
There are two end paths of the builder: Send
and Build
Build
The return type of Build is a MailMessage
in the System.Net.Mail
namespace.
var mailMessage = new MailMessageBuilder()
.SetFrom("no-reply@domain.com")
.AddRecipient("user@test.com")
.Build();
Send
The return type of Send
is void and will actually send the email if you have provided valid settings to the included proxy class.
var smtpProxy = new SmtpClientProxy();
new MailMessageBuilder(smtpProxy)
.SetFrom("no-reply@domain.com")
.AddRecipient("user@test.com")
.Send();
There is also an async version of Send
var smtpProxy = new SmtpClientProxy();
await new MailMessageBuilder(smtpProxy)
.SetFrom("no-reply@domain.com")
.AddRecipient("user@test.com")
.SendAsync();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Added support for attachments