Rask.Mail
0.20.0
See the version list below for details.
dotnet add package Rask.Mail --version 0.20.0
NuGet\Install-Package Rask.Mail -Version 0.20.0
<PackageReference Include="Rask.Mail" Version="0.20.0" />
<PackageVersion Include="Rask.Mail" Version="0.20.0" />
<PackageReference Include="Rask.Mail" />
paket add Rask.Mail --version 0.20.0
#r "nuget: Rask.Mail, 0.20.0"
#:package Rask.Mail@0.20.0
#addin nuget:?package=Rask.Mail&version=0.20.0
#tool nuget:?package=Rask.Mail&version=0.20.0
Rask.Mail
Durable transactional email for a Rask app — queued on the app's own database and delivered off the request thread, with no broker or Redis.
- Compose with a fluent
Emailbuilder; the body is a Rask component rendered to HTML, so an email template is just another component. - Call
IMailQueue.SendAsync(email)and it persists oneQueuedMailrow; a backgroundMailProcessordelivers it over SMTP — at-least-once, with exponential-backoff retries up toMaxAttempts(then left as a dead letter for inspection). - Delayed send with
ScheduleAsync(email, delay). - Zero-config in development — with no SMTP configured, mail is logged; point
PickupDirectoryat a folder to write.emlfiles instead. Production sends over SMTP via MailKit.
Use
public sealed class WelcomeEmail : Component
{
public string Name { get; set; } = "";
protected override Component? Render() =>
Div()[H1()[$"Welcome, {Name}!"], P()["Thanks for signing up."]];
}
// Program.cs
builder.Services.AddRaskMail<AppDbContext>(o =>
{
o.From = "hello@example.com";
o.Smtp = new SmtpOptions { Host = "smtp.example.com", Port = 587, User = "…", Password = "…" };
});
builder.Services.AddDbContextFactory<AppDbContext>(o => o.UseSqlite("Data Source=app.db"));
// AppDbContext.OnModelCreating: modelBuilder.AddRaskMail();
// then: rask db add AddMail && rask db update
// send from anywhere IMailQueue is injected:
await mail.SendAsync(Email
.To(user.Email, user.Name)
.Subject("Welcome")
.Body(WelcomeEmail(Name: user.Name))); // the generated factory, not new (RASK014)
await mail.ScheduleAsync(reminder, delay: TimeSpan.FromHours(24));
Register your context as an IDbContextFactory<AppDbContext>. Several instances is safe: each processor
leases the work it claims. On SQLite you will still usually run one, because SQLite is
single-writer, so the processor claims work by polling and writing. Use
UseRaskSqlite (WAL + a busy_timeout) so a concurrent send
waits for the write lock instead of failing.
Part of Rask — the .NET One Person Framework.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- MailKit (>= 4.17.0)
- Microsoft.EntityFrameworkCore (>= 10.0.10)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Rask.Mail:
| Package | Downloads |
|---|---|
|
Rask.Dashboard
A built-in operator dashboard for the Rask One Person Framework batteries. Mounts at /_ops and shows the outbox, background jobs, queued mail and cache from the application's own database — queue depth, dead letters, the errors behind them, stored email previews, the recurring-job schedule, SQLite pragmas and backup status. A live log tail is built in, and becomes a searchable history when Rask.Logging is installed. Panels appear only for the batteries the app actually registered. Protected by an authorization policy that fails closed outside Development. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.20.1-alpha.0.43 | 0 | 8/12/2026 |
| 0.20.1-alpha.0.42 | 0 | 8/12/2026 |
| 0.20.1-alpha.0.41 | 0 | 8/12/2026 |
| 0.20.1-alpha.0.40 | 0 | 8/12/2026 |
| 0.20.1-alpha.0.38 | 0 | 8/12/2026 |
| 0.20.1-alpha.0.36 | 51 | 8/10/2026 |
| 0.20.1-alpha.0.18 | 49 | 8/8/2026 |
| 0.20.1-alpha.0.17 | 54 | 8/8/2026 |
| 0.20.1-alpha.0.16 | 50 | 8/8/2026 |
| 0.20.1-alpha.0.15 | 51 | 8/7/2026 |
| 0.20.1-alpha.0.14 | 53 | 8/7/2026 |
| 0.20.1-alpha.0.13 | 52 | 8/7/2026 |
| 0.20.1-alpha.0.12 | 47 | 8/7/2026 |
| 0.20.1-alpha.0.11 | 46 | 8/7/2026 |
| 0.20.1-alpha.0.9 | 49 | 8/7/2026 |
| 0.20.1-alpha.0.8 | 57 | 8/7/2026 |
| 0.20.1-alpha.0.7 | 54 | 8/7/2026 |
| 0.20.1-alpha.0.5 | 54 | 8/7/2026 |
| 0.20.1-alpha.0.4 | 49 | 8/7/2026 |
| 0.20.0 | 62 | 8/6/2026 |