Rask.Mail 0.20.1-alpha.0.232

This is a prerelease version of Rask.Mail.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Rask.Mail --version 0.20.1-alpha.0.232
                    
NuGet\Install-Package Rask.Mail -Version 0.20.1-alpha.0.232
                    
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="Rask.Mail" Version="0.20.1-alpha.0.232" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rask.Mail" Version="0.20.1-alpha.0.232" />
                    
Directory.Packages.props
<PackageReference Include="Rask.Mail" />
                    
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 Rask.Mail --version 0.20.1-alpha.0.232
                    
#r "nuget: Rask.Mail, 0.20.1-alpha.0.232"
                    
#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 Rask.Mail@0.20.1-alpha.0.232
                    
#: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=Rask.Mail&version=0.20.1-alpha.0.232&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Rask.Mail&version=0.20.1-alpha.0.232&prerelease
                    
Install as a Cake Tool

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 Email builder; the body is a Rask component rendered to HTML, so an email template is just another component.
  • Call IMail.SendAsync(email) and it persists one QueuedMail row; a background MailProcessor delivers it over SMTP — at-least-once, with exponential-backoff retries up to MaxAttempts (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 PickupDirectory at a folder to write .eml files 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 IMail 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 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 /_rask and shows the outbox, background jobs, queued mail, cache and stored files 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.

Rask

The one reference a Rask application needs, server or browser. On a server target (net10.0 or net11.0) it brings the ASP.NET host plus every battery — database (SQLite, PostgreSQL or SQL Server, picked by Rask:Database:Provider), mediator, background jobs, transactional email, cache, file storage, outbox, operator dashboard, durable logs, Web Push, and SQLite snapshots and continuous backup — with RaskApp.Create(args) as the entry point. On a browser target it brings the WebAssembly host, the source-generated mediator, the query cache and remote dispatch. Everything referenced is wired and on; app.Configure(c => c.Jobs.Off()) is how an app does without one. Reference Rask.Server for a lean host with no database.

Rask.Auth

Register, sign in and sign out for a Rask app, on by default. Accounts are backed by ASP.NET Core Identity (versioned password hashing, lockout, security stamps) and exposed through Rask's own host-neutral surface — the same IUserProvider, Authorize component and [Authorize] routes work unchanged on the Server, WebAssembly, island, SPA and meta-framework hosts. Ships built-in overridable /login, /register and /logout pages plus the matching /api/auth endpoints, so a TypeScript front end gets the same flows. Email confirmation and password reset go out through the app's own mail queue, with /confirm-email, /forgot-password and /reset-password pages to match. The first account to register becomes the admin.

Rask.Auth.Api

Register, sign in and sign out as JSON endpoints, for an ASP.NET Core app that renders no Rask components — a TypeScript SPA host or a meta-framework host, where the front end owns the UI. Accounts are backed by ASP.NET Core Identity (versioned password hashing, lockout, security stamps) and exposed at /api/auth, with email confirmation and password reset through the app's own mail queue and optional bearer tokens. The first account to register becomes the admin. This is the host-neutral half of Rask.Auth: no components, no renderer, no Rask.Core. Add Rask.Auth instead when the app IS a Rask app and wants the built-in sign-in pages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.21.1-alpha.0.87 0 9/15/2026
0.21.1-alpha.0.83 0 9/15/2026
0.21.1-alpha.0.81 0 9/15/2026
0.21.1-alpha.0.80 0 9/15/2026
0.21.1-alpha.0.79 0 9/15/2026
0.21.1-alpha.0.78 0 9/15/2026
0.21.1-alpha.0.77 0 9/15/2026
0.21.1-alpha.0.76 0 9/15/2026
0.21.1-alpha.0.75 0 9/15/2026
0.21.1-alpha.0.74 0 9/15/2026
0.21.1-alpha.0.73 0 9/15/2026
0.21.1-alpha.0.72 0 9/15/2026
0.21.1-alpha.0.71 0 9/15/2026
0.21.1-alpha.0.70 0 9/15/2026
0.21.1-alpha.0.69 0 9/15/2026
0.21.1-alpha.0.68 0 9/15/2026
0.21.1-alpha.0.67 24 9/14/2026
0.21.1-alpha.0.66 23 9/14/2026
0.21.0 150 9/10/2026
0.20.1-alpha.0.232 67 9/7/2026
Loading failed