No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

MailSlurp - the C# library for the MailSlurp API

Documentation for MailSlurp's public REST API. ### About MailSlurp is a SAAS API for sending and receiving emails from ephemeral email inboxes. These inboxes can be created on the fly and each has a unique email address. ### Why MailSlurp was built for testing software or processes that interact with email in some way. For more information see the homepage. ### Links - Get API Key - API Documentation - Official SDK Libraries - Support / Issues - Swagger JSON ### Use You can call the MailSlurp API from any HTTP client in any language. Or you use one of the official generated SDK Libraries. - Official Typescript SDK - Official Python SDK - Official C# SDK - Official Java SDK - Official Swift SDK - Official Golang SDK - Official Javascript SDK - Official PHP SDK - Official Ruby SDK You can also compile your own library with SwaggerCodegen and the Swagger Spec. Lastly, there is an interactive GUI available at for testing requests. ### Auth An API Key must be passed as a header in all requests. To get an API Key sign up and log in to the MailSlurp Dashboard web app. ### Terms - Inbox - A unique email address - Unlimited in number - Can send and receive emails - Email - Belongs to an inbox - Contains summary and body - Raw content stored on S3 ### Issues If you encounter issues please contact the developers or open a ticket in GitHub.

This C# SDK is automatically generated by the Swagger Codegen project:

  • API version: 0.0.1-alpha
  • SDK version: 1.0.0
  • Build package: io.swagger.codegen.languages.CSharpClientCodegen For more information, please visit

Frameworks supported

  • .NET 4.0 or later
  • Windows Phone 7.1 (Mango)


The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742


Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh
  • [Windows] build.bat

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using MailSlurp.Api;
using MailSlurp.Client;
using MailSlurp.Model;


A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out MailSlurp.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Getting Started

using System;
using System.Diagnostics;
using MailSlurp.Api;
using MailSlurp.Client;
using MailSlurp.Model;

namespace Example
    public class Example
        public void main()

            // Configure API key authorization: API_KEY
            Configuration.Default.ApiKey.Add("x-api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("x-api-key", "Bearer");

            var apiInstance = new EmailControllerApi();
            var id = id_example;  // string | id

                // Delete Email
            catch (Exception e)
                Debug.Print("Exception when calling EmailControllerApi.DeleteMessageUsingDELETE: " + e.Message );


Documentation for API Endpoints

All URIs are relative to

Class Method HTTP request Description
EmailControllerApi DeleteMessageUsingDELETE DELETE /emails/{id} Delete Email
EmailControllerApi GetMessageAnalyticsUsingGET GET /emails/{id}/analytics Get Email Analytics
EmailControllerApi GetMessageUsingGET GET /emails/{id} Get Email Content
InboxControllerApi CreateInboxUsingPOST POST /inboxes Create Inbox
InboxControllerApi DeleteInboxUsingDELETE DELETE /inboxes/{id} Delete Inbox
InboxControllerApi GetInboxUsingGET GET /inboxes/{id} Get Inbox
InboxControllerApi GetInboxesUsingGET GET /inboxes List Inboxes
InboxControllerApi GetMessagesUsingGET GET /inboxes/{id}/messages List Inbox's Emails
InboxControllerApi SendMessageUsingPOST POST /inboxes/{id} Send Email
ManageEntitiesApi DeleteInboxUsingDELETE DELETE /inboxes/{id} Delete Inbox
ManageEntitiesApi DeleteMessageUsingDELETE DELETE /emails/{id} Delete Email
ManageEntitiesApi GetInboxUsingGET GET /inboxes/{id} Get Inbox
ManageEntitiesApi GetInboxesUsingGET GET /inboxes List Inboxes
ReceiveEmailsApi CreateInboxUsingPOST POST /inboxes Create Inbox
ReceiveEmailsApi GetMessageAnalyticsUsingGET GET /emails/{id}/analytics Get Email Analytics
ReceiveEmailsApi GetMessageUsingGET GET /emails/{id} Get Email Content
ReceiveEmailsApi GetMessagesUsingGET GET /inboxes/{id}/messages List Inbox's Emails
SendEmailsApi CreateInboxUsingPOST POST /inboxes Create Inbox
SendEmailsApi SendMessageUsingPOST POST /inboxes/{id} Send Email

Documentation for Models

Documentation for Authorization


  • Type: API key
  • API key parameter name: x-api-key
  • Location: HTTP header