LettermintDotNet 0.11.0

dotnet add package LettermintDotNet --version 0.11.0
                    
NuGet\Install-Package LettermintDotNet -Version 0.11.0
                    
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="LettermintDotNet" Version="0.11.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LettermintDotNet" Version="0.11.0" />
                    
Directory.Packages.props
<PackageReference Include="LettermintDotNet" />
                    
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 LettermintDotNet --version 0.11.0
                    
#r "nuget: LettermintDotNet, 0.11.0"
                    
#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 LettermintDotNet@0.11.0
                    
#: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=LettermintDotNet&version=0.11.0
                    
Install as a Cake Addin
#tool nuget:?package=LettermintDotNet&version=0.11.0
                    
Install as a Cake Tool

Lettermint C# SDK

A simple and elegant C# SDK for sending emails via Lettermint with a fluent API. Feel free to open an issue or a pull request to add more features.

Installation

Install the package via NuGet:

dotnet add package Lettermint

Or via Package Manager Console:

Install-Package Lettermint

Quick Start

1. Configure the Service

Add Lettermint to your service collection:

builder.Services.AddLettermint(options =>
{
    options.ApiKey = "your-api-key-here";
});

You can add whitelisted emails. This is good for dev og test environment where you want to make sure you dont hurt your domain reputation.

Supported formats: Exact email: "user@example.com" (also allows plus adresseing "user+tag@example.com" Domain wildcard: "*@example.com" (allows any email at this domain) Leave empty to disable filtering (all emails allowed - use in production)

builder.Services.AddLettermint(options =>
{
    options.ApiKey = "your-api-key-here";
    options.EmailWhitelist = ["email@one.dk", "Email@two.dk"];
});

2. Inject and Use

Inject ILettermintClient into your services or controllers:

public class EmailService(ILettermintClient _lettermint)
{
    public async Task SendWelcomeEmail(string recipientEmail, string name)
    {
        var response = await _lettermint.Email
            .From("noreply@yourdomain.com")
            .To(recipientEmail)
            .Subject("Welcome!")
            .Text($"Hello {name}, welcome to our service!")
            .SendAsync();

        Console.WriteLine($"Email sent! Message ID: {response.MessageId}");
    }
}

Usage Examples

Simple Text Email

var response = await _lettermint.Email
    .From("sender@example.com")
    .To("recipient@example.com")
    .Subject("Hello from Lettermint")
    .SetTextBody("This is a plain text email.")
    .SetRouteAsOutgoing()
    .SendAsync();

HTML Email

var response = await _lettermint.Email
    .From("sender@example.com")
    .To("recipient@example.com")
    .Subject("Newsletter")
    .SetHtmlBody("<h1>Welcome!</h1><p>Thank you for subscribing.</p>")
    .SetRouteAsOutgoing()
    .SendAsync();

All Email methods

var response = await _lettermint.Email
    .From("sender@example.com")
    .From("John", "john@john.com")
    .To("recipient@example.com")
    .To("John", "john@john.com")
    .Tag("Login")
    .Subject("Newsletter")
    .SetTextBody("This is a plain text email.")
    .SetHtmlBody("<h1>Welcome!</h1><p>Thank you for subscribing.</p>")
    .SetRouteAsOutgoing()
    .SetRouteAsBroadcast()
    .SetRoute("specificroute")
    .IdempotencyKey("12345678")
    .SendAsync();

License

MIT

Support

For issues and questions, please visit GitHub Issues.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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.

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
0.11.0 718 3/4/2026
0.9.0 227 2/10/2026
0.8.0 137 2/9/2026
0.7.0 125 2/8/2026
0.6.0 701 10/9/2025
0.4.0 194 10/6/2025
0.3.0 190 10/6/2025
0.2.0 190 10/6/2025
0.1.0 191 10/6/2025