MailinatorApiClient 2.0.0

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

Mailinator C# SDK

The official Mailinator C# SDK. This package is a thin, asynchronous wrapper around the Mailinator REST API, and the Mailinator OpenAPI specification is the source of truth for documented endpoints.

The SDK targets .NET Framework 4.7.1 and .NET Standard 2.0.

Installation

Install the MailinatorApiClient package from NuGet:

dotnet add package MailinatorApiClient

Package Manager Console:

Install-Package MailinatorApiClient

PackageReference:

<PackageReference Include="MailinatorApiClient" Version="YOUR_VERSION" />

Upgrading from 1.0.7 to 2.0.0

Version 2.0.0 upgrades RestSharp from 112.0.0 to 114.0.0. RestSharp types are part of this SDK's public API, including IHttpClient and DynamicJsonSerializer, so consumers must account for RestSharp's breaking changes:

  • Align any direct RestSharp references with 114.0.0 and rebuild consuming applications and libraries.
  • If you implement RestSharp's IAuthenticator, update Authenticate to accept the optional CancellationToken parameter.
  • If you access ReadOnlyRestClientOptions.FollowRedirects or MaxRedirects, migrate to RedirectOptions.
  • Recompile code using RestSharp's generic parameter extension methods, whose signatures now include an optional culture parameter.

See the RestSharp 114 changelog for details. The SDK continues to target .NET Framework 4.7.1 and .NET Standard 2.0.

Message listing now sends the documented ascending and descending sort query values. Continue using Sort.asc and Sort.desc in C#.

Quick start

Create a Mailinator account, then obtain an API token from Team Settings > API Tokens. Keep the token outside your source code—for example, in an environment variable.

using System;
using mailinator_csharp_client;
using mailinator_csharp_client.Models.Messages.Entities;
using mailinator_csharp_client.Models.Messages.Requests;

var apiToken = Environment.GetEnvironmentVariable("MAILINATOR_API_TOKEN");
if (string.IsNullOrEmpty(apiToken))
{
    throw new InvalidOperationException("Set MAILINATOR_API_TOKEN before running this example.");
}

var client = new MailinatorClient(apiToken);
var response = await client.MessagesClient.FetchInboxAsync(
    new FetchInboxRequest
    {
        Domain = "your-private-domain.com",
        Inbox = "your-inbox",
        Skip = 0,
        Limit = 20,
        Sort = Sort.desc
    });

All API operations are asynchronous and end in Async. Operations are grouped under MessagesClient, DomainsClient, AuthenticatorsClient, StatsClient, WebhooksClient, and RulesClient.

For complete workflows, including domain message listing, message content, headers, attachments, and webhooks, see EXAMPLES.md.

Documentation

Authentication

Construct MailinatorClient with an API token for messages, domains, authenticators, stats, and rules:

var client = new MailinatorClient(apiToken);

Webhook injection uses a webhook token in the request URL and does not use an API token. The parameterless client constructor initializes WebhooksClient for these calls:

var webhookClient = new MailinatorClient();

See the webhook examples for complete requests.

Deprecated APIs

Some older SDK operations do not appear in the current OpenAPI specification. They remain available for compatibility but are marked with [Obsolete] and may be removed in a future major release. See the compatibility decisions in ROADMAP.md.

Development

Build the solution when the installed .NET SDK supports all target frameworks:

dotnet build mailinator-csharp-client.sln

Run the fast, offline unit tests:

dotnet test mailinator-csharp-client-unit-tests/mailinator-csharp-client-unit-tests.csproj

The separate legacy integration suite calls the live Mailinator API and requires deliberate account configuration. Some tests create or delete remote resources. Read TESTING.md before running it.

To compare the SDK request surface with the OpenAPI specification, use the OpenAPI coverage check.

Maintainers should follow RELEASING.md to publish NuGet packages and matching GitHub Releases.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 is compatible.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
2.0.0 594 9/29/2026
1.0.7 2,977 8/15/2026
1.0.6 88,708 3/5/2025
1.0.5 42,092 8/30/2024
1.0.4 26,809 2/23/2024
1.0.3 100,834 11/16/2023
1.0.2 90,182 8/12/2022
1.0.1 81,866 9/23/2020
1.0.0 6,414 9/17/2020