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