CSharp Email API for DotNET and ASP

Receive email in DotNET Core using C# and MailSlurp

read email csharp

MailSlurp is a powerful, free API for creating real email addresses in C#, F#, and DotNET. You can send and receive email addresses from tests and applications and manage your accounts using a webapp.

Get started

CSharp email examples

First add the .NET email package from Nuget:

dotnet add package mailslurp
dotnet restore

Then create a configuration with your api key. Next create an email account using the inbox controller.

using mailslurp.Api;
using mailslurp.Client;
using mailslurp.Model;

var config = new Configuration();
config.ApiKey.Add("x-api-key", "your_api_key_here");

// now create an email address
var apiInstance = new InboxControllerApi(config);
var inbox = apiInstance.CreateInbox();

Assert.Contains("@mailslurp.com", inbox.EmailAddress);

Related content

CSharp Email API and SMTP library

Receive email in DotNET Core using C# and MailSlurp

Golang email library for sending and reading emails

Golang Email Library for sending and receiving emails in Go over SMTP or HTTP/S.


PHP email API for creating inboxes, sending email, and receiving attachments in code and tests.

Ruby Mailer SDK - send and receive emails in Rails, Rspec and more using MailSlurp's official email Gem

Receive email and attachments with Rails, Rspec, and Ruby without SMTP using MailSlurp Ruby Gem.

The Most Advanced Guide on Azure Email Sending.

The Most Advanced Guide on Azure Email Sending.

How to fix the any package by glob error in dotnet

Fix .NET installation on Linux for missing dotnet dependencies.

Disposable email accounts for DotNET core 6

Create real throw-away email addresses for testing and development in .NET core. Follow this guide to get started.

DotNET Core Cake Task Runner (CSharp Makefiles for coverlet code coverage and more)

Create cross platform build scripts for DotNET Core in a way similar to Makefiles.

Create a new .NET MVC project starter (with the CLI)

DotNet starter project MVC generation using the command line interface.

Mailinator alternative

Alternatives to Mailinator for test email accounts. Create real email addresses using MailSlurp

How to send an email using Powershell (Windows and cross-platform)

Use Send-MailMessage in Windows Powershell to send emails using an SMTP server or MailSlurp's free email API.

Specflow user sign-up testing with MailSlurp accounts

How to test .NET authentication and sign-up using real email accounts with MailSlurp and SpecFlow.

.NET Selenium C#

Send and receive email in DotNET Nunit tests using Selenium and MailSlurp.

CSharp Email Tutorial

SMTP mailserver testing and usage in CSharp using

Send email with CSharp using SMTP Client and MailSlurp

Create a custom SMTP client and access MailSlurp inboxes from CSharp/DotNET.

GraphQL Email API

Fetch and read emails with GraphQL inboxes using MailSlurp email API.

How to send emails in VBA

Send email in Visual basic

CSharp send SMTP email

How to use CSharp SMTP client to send email with MailSlurp mail server

Ready to dive in?Start building email applications today.