SendMail.NET.Core
1.1.4
Suggested Alternatives
dotnet add package SendMail.NET.Core --version 1.1.4
NuGet\Install-Package SendMail.NET.Core -Version 1.1.4
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="SendMail.NET.Core" Version="1.1.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SendMail.NET.Core" Version="1.1.4" />
<PackageReference Include="SendMail.NET.Core" />
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 SendMail.NET.Core --version 1.1.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SendMail.NET.Core, 1.1.4"
#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 SendMail.NET.Core@1.1.4
#: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=SendMail.NET.Core&version=1.1.4
#tool nuget:?package=SendMail.NET.Core&version=1.1.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SendMail.NET
A flexible and extensible email sending pipeline for .NET applications.
Features
- Multiple email provider support
- SMTP (Gmail, Office 365, etc.)
- AWS SES (Amazon Simple Email Service)
- Quota management
- Environment-specific configurations
- Runtime configuration reloading
- Fallback mechanisms
- Retry policies
Installation
dotnet add package SendMail.NET.Core
Version History
1.1.0
- Added AWS SES provider support
- Improved configuration validation
- Enhanced error handling
1.0.0
- Initial release
- SMTP provider support
- Basic pipeline functionality
Quick Start
// Add SendMail.NET services
builder.Services.AddSendMail(config =>
{
// Configure SMTP provider
config.AddProvider<SmtpEmailProvider>(options =>
{
options.Name = "SMTP";
options.Priority = 1;
options.HourlyQuota = 100;
options.Settings["Host"] = "smtp.gmail.com";
options.Settings["Port"] = "587";
options.Settings["EnableSsl"] = "true";
options.Settings["Username"] = "your-email@gmail.com";
options.Settings["Password"] = "your-app-password";
options.Settings["DefaultFrom"] = "your-email@gmail.com";
});
// Configure AWS SES provider
config.AddProvider<AwsSesEmailProvider>(options =>
{
options.Name = "AWS SES";
options.Priority = 2;
options.HourlyQuota = 1000;
options.Settings["Region"] = "us-east-1";
options.Settings["AccessKey"] = "your-access-key";
options.Settings["SecretKey"] = "your-secret-key";
options.Settings["DefaultFrom"] = "your-verified-email@domain.com";
});
// Configure provider behavior
config.ConfigureProviders(options =>
{
options.EnableFallback = true;
options.MaxRetries = 3;
});
// Use default pipeline
config.UseDefaultPipeline();
});
// Inject and use the service
public class YourService
{
private readonly IEmailService _emailService;
public YourService(IEmailService emailService)
{
_emailService = emailService;
}
public async Task SendEmailAsync()
{
var email = new EmailMessage
{
To = "recipient@example.com",
Subject = "Test Email",
Body = "Hello from SendMail.NET!"
};
await _emailService.SendAsync(email);
}
}
Configuration
appsettings.json
{
"SendMail": {
"Providers": [
{
"Name": "SMTP",
"Priority": 1,
"HourlyQuota": 100,
"Settings": {
"Host": "smtp.gmail.com",
"Port": "587",
"EnableSsl": "true",
"Username": "your-email@gmail.com",
"Password": "your-app-password",
"DefaultFrom": "your-email@gmail.com"
}
},
{
"Name": "AWS SES",
"Priority": 2,
"HourlyQuota": 1000,
"Settings": {
"Region": "us-east-1",
"AccessKey": "your-access-key",
"SecretKey": "your-secret-key",
"DefaultFrom": "your-verified-email@domain.com"
}
}
],
"EnableFallback": true,
"MaxRetries": 3
}
}
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
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 | net7.0 is compatible. 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 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.
-
net7.0
- AWSSDK.SimpleEmail (>= 3.7.300.52)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Options (>= 7.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.