Katalyst.Email.Resend
1.0.0
dotnet add package Katalyst.Email.Resend --version 1.0.0
NuGet\Install-Package Katalyst.Email.Resend -Version 1.0.0
<PackageReference Include="Katalyst.Email.Resend" Version="1.0.0" />
<PackageVersion Include="Katalyst.Email.Resend" Version="1.0.0" />
<PackageReference Include="Katalyst.Email.Resend" />
paket add Katalyst.Email.Resend --version 1.0.0
#r "nuget: Katalyst.Email.Resend, 1.0.0"
#:package Katalyst.Email.Resend@1.0.0
#addin nuget:?package=Katalyst.Email.Resend&version=1.0.0
#tool nuget:?package=Katalyst.Email.Resend&version=1.0.0
Katalyst Email - Resend
.NET library for sending transactional email through Resend using the official Resend .NET SDK. Configuration binds Email:Resend (API key, default sender) and registers IEmailSender.
Requirements
- .NET 10 SDK
- A Resend account and API key
Installation
Add the Katalyst.Email.Resend package to your app (from your NuGet feed or a project reference to Email/Email.Resend/Email.Resend.csproj).
dotnet add package Katalyst.Email.Resend
Resend and domain setup
Before the library can send mail, configure Resend and your sending domain.
- Create an API key in the Resend dashboard (API Keys). Use a key with permission to send email.
- Add and verify a domain in Resend (Domains). Complete DNS records (SPF, DKIM, etc.) until the domain shows as verified.
- Choose a “from” address that uses your verified domain, for example
noreply@mail.example.com. Resend will reject or fail sends if the domain is not verified or the address is not allowed for your account. - Optional — templates for
SendTemplatedAsync: create a template in Resend, publish it, and copy its template UUID from the dashboard.
Official help: Resend documentation.
Configuration
The library reads Email:Resend (see EmailOptions.SectionName). Other email providers can live under sibling paths under Email without colliding with Resend settings.
| Setting | Description |
|---|---|
ApiKey |
Resend API key (re_...) from the dashboard. |
IsApiKeyEncrypted |
Set to false when ApiKey is the value exactly as shown in the Resend dashboard. |
DefaultFrom:Address |
Default sender email (must align with your verified domain). |
DefaultFrom:Name |
Optional display name for the default sender. |
Example appsettings.json:
{
"Email": {
"Resend": {
"ApiKey": "re_xxxxxxxxxxxxxxxxxxxxxxxx",
"IsApiKeyEncrypted": false,
"DefaultFrom": {
"Address": "noreply@mail.yourdomain.com",
"Name": "Your App"
}
}
}
}
Environment variables override JSON when both are loaded (the development tool merges environment variables after the file). Use the double-underscore form, for example:
Email__Resend__ApiKeyEmail__Resend__IsApiKeyEncryptedEmail__Resend__DefaultFrom__AddressEmail__Resend__DefaultFrom__Name
Using the library (step by step)
Add configuration — Add the
Email:Resendsection toappsettings.json(or supply the same keys via environment variables / secret store) with a validApiKeyandDefaultFrom.Register services — In your host setup, call
AddResendEmailwith your rootIConfiguration:using Email.Resend.DependencyInjection; builder.Services.AddResendEmail(builder.Configuration);Inject
IEmailSender— ResolveEmail.Resend.Abstractions.IEmailSenderin constructors or minimal APIs.Build a message — Use
EmailMessagefor plain HTML/text, orTemplatedEmailMessagefor a published Resend template (template id must be a GUID string).Send — Call
SendAsyncorSendTemplatedAsync. At least one ofTextBodyorHtmlBodyis required for non-template sends;Subjectand at least oneTorecipient are required.
If you omit From on a message, the sender defaults to Email:Resend:DefaultFrom.
Examples
Plain HTML and text email
using Email.Resend.Abstractions;
var message = new EmailMessage(
Subject: "Welcome",
To: [new EmailContact("user@example.com", "User Name")],
TextBody: "Welcome to the app.",
HtmlBody: "<p>Welcome to the <strong>app</strong>.</p>");
await emailSender.SendAsync(message);
Custom from, CC, and BCC
var message = new EmailMessage(
Subject: "Invoice ready",
To: [new EmailContact("customer@example.com")],
TextBody: "Your invoice is attached in the portal.",
From: new EmailContact("billing@mail.yourdomain.com", "Billing"),
Cc: [new EmailContact("finance@yourdomain.com")],
Bcc: [new EmailContact("archive@yourdomain.com")]);
await emailSender.SendAsync(message);
Resend template (published template UUID)
var message = new TemplatedEmailMessage(
TemplateId: "00000000-0000-0000-0000-000000000000",
To: [new EmailContact("user@example.com")],
TemplateVariables: new Dictionary<string, object>
{
["name"] = "Alex",
["resetLink"] = "https://app.example.com/reset?token=..."
});
await emailSender.SendTemplatedAsync(message);
Replace the GUID with your template’s id from the Resend dashboard.
Development: Email.Resend.Tool
The console app Email/Email.Resend.Tool runs quick send smoke tests against your appsettings.json.
Prerequisites
- From the repository root (or adjust paths), ensure
dotnetcan buildEmail/Email.Resend.Tool. - Edit
Email/Email.Resend.Tool/appsettings.jsonin the repo (it is copied to the build output).sendandsend-templateloadappsettings.jsonnext to the tool assembly by default, sodotnet run --project Email/Email.Resend.Tool -- send …works from any working directory. Pass--config <path>to use another file. The tool bindsEmail:Resendthe same way asAddResendEmail.
Commands
| Command | Purpose |
|---|---|
send [--config <path>] <to-email> |
Send a simple test message using configured defaults. |
send-template [--config <path>] <template-uuid> <to-email> |
Send a published template by id. |
help |
Show usage. |
Examples
# From repository root
dotnet run --project Email/Email.Resend.Tool -- send you@example.com
dotnet run --project Email/Email.Resend.Tool -- send --config C:\path\to\appsettings.json you@example.com
dotnet run --project Email/Email.Resend.Tool -- send-template 00000000-0000-0000-0000-000000000000 you@example.com
After dotnet build, you can run the executable from Email/Email.Resend.Tool/bin/Debug/net10.0/ with the same arguments (for example Email.Resend.Tool.exe send you@example.com on Windows).
Solution layout
Email/Email.Resend— packable library (NuGet id:Katalyst.Email.Resend).Email/Email.Resend.Tool— development CLI (not published as a package).Email/Email.slnx— solution file.
dotnet build Email/Email.slnx
| 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
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Http (>= 10.0.0)
- Microsoft.Extensions.Logging (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.0)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.0)
- Resend (>= 0.5.0)
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.0.0 | 151 | 5/3/2026 |