MailVolt
Modern .NET email library. Drop-in replacement for FluentEmail.
Why MailVolt?
| FluentEmail Problem |
MailVolt Solution |
| Abandoned since 2022 |
Actively maintained |
| No async API |
Async-only from day one |
| No DI-first design |
DI-first with MailVoltBuilder |
| No batch sending |
IBatchEmailSender with concurrency control |
| No SendGrid inline images |
Supported |
| No Mailgun ReplyTo |
Fixed |
| No test helpers |
InMemorySender + FluentAssertions |
| RazorLight dependency |
Native ASP.NET Core Razor |
Quick Start (AutoConfigure)
dotnet add package MailVolt.AutoConfigure
{
"MailVolt": {
"From": { "Address": "noreply@example.com", "DisplayName": "My App" },
"Transport": "Smtp",
"Templates": "Razor",
"Smtp": {
"Host": "smtp.mailtrap.io",
"Port": 587,
"Username": "USER",
"Password": "PASS"
}
}
}
// Program.cs — one line, everything from config
builder.Services.AddMailVolt(builder.Configuration);
Switch providers without changing code — just update Transport in config and add the matching section.
Supports: Smtp · SendGrid · Mailgun · Resend · Postmark · Azure · Brevo · AwsSes · InMemory
Quick Start
// 1. Install
// dotnet add package MailVolt.Core
// dotnet add package MailVolt.Transport.Smtp
// 2. Register
services.AddMailVolt()
.UseSmtpTransport(options =>
{
options.Host = "smtp.example.com";
options.Username = "user";
options.Password = "pass";
});
// 3. Send
var builder = services.GetRequiredService<IEmailBuilder>();
var result = await builder
.From("sender@example.com")
.To("recipient@example.com")
.Subject("Hello from MailVolt!")
.HtmlBody("<h1>Welcome!</h1>")
.SendAsync();
Installation
| Package |
Command |
| Core |
dotnet add package MailVolt.Core |
MailVolt.AutoConfigure |
Zero-code setup — configure everything via appsettings.json |
| Testing |
dotnet add package MailVolt.Testing |
| Templates: Razor |
dotnet add package MailVolt.Templates.Razor |
| Templates: Liquid |
dotnet add package MailVolt.Templates.Liquid |
| Templates: Handlebars |
dotnet add package MailVolt.Templates.Handlebars |
Senders
| Provider |
Package |
Docs |
| SMTP (MailKit) |
MailVolt.Transport.Smtp |
| SendGrid |
MailVolt.Transport.SendGrid |
| Mailgun |
MailVolt.Transport.Mailgun |
| Resend |
MailVolt.Transport.Resend |
| Postmark |
MailVolt.Transport.Postmark |
| Azure Email |
MailVolt.Transport.AzureEmail |
| Brevo |
MailVolt.Transport.Brevo |
| AWS SES |
MailVolt.Transport.AwsSes |
Templates
| Engine |
Package |
Docs |
| Razor (.cshtml) |
MailVolt.Templates.Razor |
| Liquid |
MailVolt.Templates.Liquid |
| Handlebars |
MailVolt.Templates.Handlebars |
Batch Sending
var batchSender = services.GetRequiredService<IBatchEmailSender>();
var result = await batchSender.SendBatchAsync(emails, new BatchSendOptions
{
MaxConcurrency = 10,
FailureStrategy = FailureStrategy.Continue
});
Console.WriteLine($"Sent {result.SentCount}/{result.TotalCount}");
Testing
// Arrange
services.AddMailVolt().UseInMemoryTransport();
var sender = services.GetRequiredService<InMemorySender>();
// Act
await service.SendEmailAsync();
// Assert
sender.Should().HaveCount(1);
sender.Should().ContainEmailTo("user@example.com");
sender.Should().ContainSubject("Welcome!");
Documentation
License