Skip to content
No description, website, or topics provided.
C# Other
  1. C# 99.5%
  2. Other 0.5%
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

For documentation see developer guide. Create an account in the MailSlurp Dashboard to view your API Key. For all bugs, feature requests, or help please see support.

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: 0.0.1-alpha
  • SDK version: 4.9.0
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegen For more information, please visit

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.6
  • Mono/Xamarin >=vNext
  • UWP >=10.0


  • FubarCoder.RestSharp.Portable.Core >=4.0.7
  • FubarCoder.RestSharp.Portable.HttpClient >=4.0.7
  • Newtonsoft.Json >=10.0.3


Generate the DLL using your preferred tool

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;

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 CommonOperationsApi();

                // Create new email address
                Inbox result = apiInstance.CreateNewEmailAddress();
            catch (Exception e)
                Debug.Print("Exception when calling CommonOperationsApi.CreateNewEmailAddress: " + e.Message );


Documentation for API Endpoints

All URIs are relative to

Class Method HTTP request Description
CommonOperationsApi CreateNewEmailAddress POST /newEmailAddress Create new email address
CommonOperationsApi DeleteEmail DELETE /deleteEmail Delete an email
CommonOperationsApi DeleteEmailAddress DELETE /deleteEmailAddress Delete email address and its emails
CommonOperationsApi EmptyInbox DELETE /emptyInbox Delete all emails in an inbox
CommonOperationsApi SendEmailSimple POST /sendEmail Send an email from a random email address
CommonOperationsApi WaitForEmailCount GET /waitForEmailCount Wait for and return count number of emails
CommonOperationsApi WaitForLatestEmail GET /waitForLatestEmail Fetch inbox's latest email or if empty wait for email to arrive
CommonOperationsApi WaitForMatchingEmail POST /waitForMatchingEmails Wait or return list of emails that match simple matching patterns
CommonOperationsApi WaitForNthEmail GET /waitForNthEmail Wait for or fetch the email with a given index in the inbox specified
ExtraOperationsApi BulkCreateInboxes POST /bulk/inboxes Bulk create Inboxes (email addresses)
ExtraOperationsApi BulkDeleteInboxes DELETE /bulk/inboxes Bulk Delete Inboxes
ExtraOperationsApi BulkSendEmails POST /bulk/send Bulk Send Emails
ExtraOperationsApi CreateInbox POST /inboxes Create an Inbox (email address)
ExtraOperationsApi CreateWebhook POST /inboxes/{inboxId}/webhooks Attach a WebHook URL to an inbox
ExtraOperationsApi DeleteEmail1 DELETE /emails/{emailId} Delete Email
ExtraOperationsApi DeleteInbox DELETE /inboxes/{inboxId} Delete Inbox / Email Address
ExtraOperationsApi DeleteWebhook DELETE /inboxes/{inboxId}/webhooks/{webhookId} Delete and disable a WebHook for an Inbox
ExtraOperationsApi DownloadAttachment GET /emails/{emailId}/attachments/{attachmentId} Get email attachment
ExtraOperationsApi ForwardEmail POST /emails/{emailId}/forward Forward Email
ExtraOperationsApi GetEmail GET /emails/{emailId} Get Email Content
ExtraOperationsApi GetEmails GET /inboxes/{inboxId}/emails List Emails in an Inbox / EmailAddress
ExtraOperationsApi GetInbox GET /inboxes/{inboxId} Get Inbox / EmailAddress
ExtraOperationsApi GetInboxes GET /inboxes List Inboxes / Email Addresses
ExtraOperationsApi GetRawEmailContents GET /emails/{emailId}/raw Get Raw Email Content
ExtraOperationsApi GetWebhooks GET /inboxes/{inboxId}/webhooks Get all WebHooks for an Inbox
ExtraOperationsApi SendEmail POST /inboxes/{inboxId} Send Email
ExtraOperationsApi UploadAttachment POST /attachments Upload an attachment for sending
ExtraOperationsApi UploadMultipartForm POST /attachments/multipart Upload an attachment for sending using Multipart Form

Documentation for Models

Documentation for Authorization


  • Type: API key
  • API key parameter name: x-api-key
  • Location: HTTP header
You can’t perform that action at this time.