CommonNetFuncs.Email
4.3.13
dotnet add package CommonNetFuncs.Email --version 4.3.13
NuGet\Install-Package CommonNetFuncs.Email -Version 4.3.13
<PackageReference Include="CommonNetFuncs.Email" Version="4.3.13" />
<PackageVersion Include="CommonNetFuncs.Email" Version="4.3.13" />
<PackageReference Include="CommonNetFuncs.Email" />
paket add CommonNetFuncs.Email --version 4.3.13
#r "nuget: CommonNetFuncs.Email, 4.3.13"
#:package CommonNetFuncs.Email@4.3.13
#addin nuget:?package=CommonNetFuncs.Email&version=4.3.13
#tool nuget:?package=CommonNetFuncs.Email&version=4.3.13
CommonNetFuncs.Email
This contains helper methods for sending emails in .NET applications. It includes a simple interface for sending emails as well as an implementation that can be used directly or consumed as a service.
Contents
Helper class for sending emails
Email Usage Examples
<details> <summary><h3>Usage Examples</h3></summary>
SendEmail
Sends an email with the specified parameters. Can be consumed as a service using the IEmailService interface and EmailService implementation of that service.
SmtpSettings smtpSettings = new("smtp.server.address", 25);
EmailAddresses emailAddresses = new(
fromAddress: new MailAddress("Nick", "NickEmail@test.com"),
toAddresses: [new MailAddress("Chris", "ChrisEmail@test.com")]);
await using FileStream attachmentStream = new(@"C:\Documents\Important Attachment.txt", FileMode.Open, FileAccess.Read);
// Attachment data is compressed in memory (Gzip, CompressionLevel.Optimal by default) and transparently decompressed when the email is sent
MailAttachment attachment = new("Important Attachment.txt", attachmentStream);
EmailContent emailContent = new(
subject: "Subject Line",
body: "Mail Body",
attachments: [attachment],
zipAttachments: true); // Sends email with zipped attachment
bool success = await SendEmail(new SendEmailConfig(smtpSettings, emailAddresses, emailContent));
MailAttachment and MailAttachmentBytes both accept an optional CompressionLevel parameter to control how the attachment is compressed while held in memory (defaults to CompressionLevel.Optimal). MailAttachmentBytes stores the attachment as a byte[] instead of a Stream, making it serialization-friendly for scenarios such as Hangfire background jobs - use it along with EmailContentBytes/SendEmailConfigBytes in those cases.
</details>
Installation
Install via NuGet:
dotnet add package CommonNetFuncs.Email
License
This project is licensed under the MIT License - see the LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. 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. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- CommonNetFuncs.Compression (>= 4.4.3)
- CommonNetFuncs.Core (>= 4.3.11)
- MailKit (>= 4.18.1)
- MimeKit (>= 4.18.1)
- System.Text.Json (>= 10.0.12)
- ZLinq (>= 1.5.6)
-
net10.0
- CommonNetFuncs.Compression (>= 4.4.3)
- CommonNetFuncs.Core (>= 4.3.11)
- CommonNetFuncs.Hangfire (>= 4.3.5)
- MailKit (>= 4.18.1)
- MimeKit (>= 4.18.1)
- ZLinq (>= 1.5.6)
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 |
|---|---|---|
| 4.3.13 | 95 | 9/28/2026 |
| 4.3.12 | 111 | 9/21/2026 |
| 4.3.11 | 103 | 9/18/2026 |
| 4.3.10 | 103 | 9/15/2026 |
| 4.3.8 | 113 | 9/1/2026 |
| 4.3.7 | 103 | 8/31/2026 |
| 4.3.5 | 107 | 8/31/2026 |
| 4.3.4 | 108 | 8/27/2026 |
| 4.3.3 | 118 | 8/24/2026 |
| 4.3.2 | 120 | 8/14/2026 |
| 4.3.1 | 115 | 8/11/2026 |
| 4.3.0 | 120 | 8/3/2026 |
| 4.1.15 | 119 | 8/3/2026 |
| 4.1.13 | 119 | 7/31/2026 |
| 4.1.12 | 130 | 7/16/2026 |
| 4.1.11 | 135 | 7/9/2026 |
| 4.1.0 | 150 | 6/5/2026 |
| 4.0.53 | 141 | 5/28/2026 |
| 4.0.51 | 142 | 5/27/2026 |