VOOZH about

URL: https://www.nuget.org/packages/GaEpd.EmailService/

⇱ NuGet Gallery | GaEpd.EmailService 1.5.0




👁 Image
GaEpd.EmailService 1.5.0

Prefix Reserved
dotnet add package GaEpd.EmailService --version 1.5.0
 
 
NuGet\Install-Package GaEpd.EmailService -Version 1.5.0
 
 
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="GaEpd.EmailService" Version="1.5.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GaEpd.EmailService" Version="1.5.0" />
 
Directory.Packages.props
<PackageReference Include="GaEpd.EmailService" />
 
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 GaEpd.EmailService --version 1.5.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: GaEpd.EmailService, 1.5.0"
 
 
#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 GaEpd.EmailService@1.5.0
 
 
#: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=GaEpd.EmailService&version=1.5.0
 
Install as a Cake Addin
#tool nuget:?package=GaEpd.EmailService&version=1.5.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Georgia EPD-IT Email Service Library

This library was created by Georgia EPD-IT to provide common email services for our web applications.

👁 Georgia EPD-IT
👁 .NET Test
👁 SonarCloud Quality Gate Status
👁 Lines of Code

Installation

👁 Nuget

To install, search for "GaEpd.EmailService" in the NuGet package manager or run the following command:

dotnet add package GaEpd.EmailService

Usage

The IEmailService interface provides a single method, SendEmailAsync(Message message), which sends an email Message. Typical usage would look like this:

// Create the email message.
var message = Message.Create(subject, recipientEmail, textBody, htmlBody, senderName, senderEmail, [ccRecipient]);

// Send the message. There is no need to await this call.
_ = emailService.SendEmailAsync(message, token);

Configuration

The AddEmailService() extension method can be used to register the included implementation with your configuration settings. The DefaultEmailService implementation uses MailKit to send emails.

builder.Services.AddEmailService(builder.Configuration);

The following configuration section should be added to your configuration file:

{
 "EmailServiceSettings": {
 "EnableEmail": true,
 "SmtpHost": "localhost",
 "SmtpPort": 25,
 "SecureSocketOption": "Auto",
 "DefaultSenderName": "Default Sender",
 "DefaultSenderEmail": "Default.Sender@email.invalid",
 "EnableEmailAuditing": true,
 "AuditEmailRecipients": [
 "Audit.Recipient@email.invalid"
 ]
 }
}
  • EnableEmail: Set to true to enable sending emails.
  • SmtpHost: The SMTP server to use for sending emails. (Only used if EnableEmail is true.)
  • SmtpPort: The port to use for the SMTP server. (Only used if EnableEmail is true.)
  • SecureSocketOption: The MailKit SecureSocketOption to use for the SMTP server. (Only used if EnableEmail is true.) Available options are None, Auto, SslOnConnect, StartTls, and StartTlsWhenAvailable. See the MailKit documentation for a description of each option.
  • DefaultSenderName: The default sender name (optional, can also be set per message).
  • DefaultSenderEmail: The default sender email address (optional, can also be set per message).
  • EnableEmailAuditing: Set to true to enable sending audit emails (useful for testing purposes).
  • AuditEmailRecipients: A list of email addresses to send audit emails to. (Only used if EnableEmailAuditing is true.)

Note that EnableEmail and EnableEmailAuditing operate independently of each other. You can enable or disable each feature individually.

Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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
1.5.0 577 5/4/2026
1.4.2 379 4/15/2026
1.4.1 720 2/20/2026
1.4.0 523 1/7/2026
1.3.0 636 11/26/2025
1.2.0 1,470 6/2/2025
1.1.1 530 6/2/2025
1.1.0 1,575 1/28/2025
1.0.0 1,102 12/4/2024

# Changelog
## [1.5.0] - 2026-05-04
- Email recipients (and CC recipients) can now be formatted with display names. For example,
`"User Name <user.name@example.com>"`.
## [1.4.2] - 2026-04-15
- Updated NuGet packages.
## [1.4.1] - 2026-02-10
- Fixed a bug where an exception was thrown when a client application left the sender email null when creating a new
message. It now uses the default sender as intended.
## [1.4.0] - 2026-01-07
- Added support for .NET 10.
## [1.3.0] - 2025-11-26
- **Breaking change:** Async SMTP operations are now awaited allowing for appropriate capture of any exceptions.
- **Breaking change:** Email addresses are now validated when creating an email message. Invalid addresses will throw
an `ArgumentException`.
## [1.2.0] - 2025-06-02
- **Breaking change:** The Email Log DB entity, repository interface, and associated setting have all been removed. The
benefit of having these items in the package was negligible. Any desired email logging will need to be independently
implemented by each client application. If your app relied on these items, you can find the originals here and copy
them to your own codebase:
- [EmailLog](https://github.com/gaepdit/email-service/blob/388fb6f29525a3930ba8a5e88ea83f192fdcc1ae/src/EmailService/EmailLogRepository/EmailLog.cs)
- [IEmailLogRepository](https://github.com/gaepdit/email-service/blob/388fb6f29525a3930ba8a5e88ea83f192fdcc1ae/src/EmailService/EmailLogRepository/IEmailLogRepository.cs)
## [1.1.1] - 2025-06-02
- Fixed: Audit emails were formatted incorrectly for emails with no HTML body.
## [1.1.0] - 2025-01-28
- Target .NET 8 & 9.
- Fixed: Email sender was truncated more than required when saving to the repository.
## [1.0.0] - 2024-12-04
_Initial release._
[1.0.0]: https://github.com/gaepdit/email-service/releases/tag/v1.0.0
[1.1.0]: https://github.com/gaepdit/email-service/releases/tag/v1.1.0
[1.1.1]: https://github.com/gaepdit/email-service/releases/tag/v1.1.1
[1.2.0]: https://github.com/gaepdit/email-service/releases/tag/v1.2.0
[1.3.0]: https://github.com/gaepdit/email-service/releases/tag/v1.3.0
[1.4.0]: https://github.com/gaepdit/email-service/releases/tag/v1.4.0
[1.4.1]: https://github.com/gaepdit/email-service/releases/tag/v1.4.1
[1.4.2]: https://github.com/gaepdit/email-service/releases/tag/v1.4.2
[1.5.0]: https://github.com/gaepdit/email-service/releases/tag/v1.5.0