Videos
Check out our tutorial video series.
Create real throw-away email addresses for testing and development in .NET core. Follow this guide to get started.
Building applications in .NET is fun and productive but what do you do when you need to add email integrations or test using disposable email accounts? MailSlurp's free DotNET SDK client on nuget lets you create real inboxes on demand for sending and receiving emails in C#, F# and more.
DotNET was never known for simple naming conventions. Microsoft's open source .NET 6 aims to fix some of the confusing while adding many new performance upgrades and features. To install on Linux 21.04 run:
The use aptitude to install the sdk:
Then install the runtimes:
If you encounter errors about missing packages you may need to purge your dpkg packages
Running should now display version 6.
To scaffold a new application that we can add disposable email accounts to use the dotnet command in the CLI.
This will create a new folder with a structure like so:
You can add disposable email accounts to your .NET core project easily using the dotnet CLI:
Our csproj file will be updated to include our dependency and look something like this:
Make sure you create a free MailSlurp account to obtain a free API_KEY. We will need that for the next steps.
To configure inboxes import the MailSlurp dependency in your file and configure it like below:
Now you are probably wondering - how do I use these email addresses? Well with MailSlurp you can create email inboxes and then send and receive emails from them using any email provider, the online dashboard, or in code.
First step, create an inbox for your test:
Sending emails with MailSlurp is simple:
You can receive emails in .NET using MailSlurp too:
Notice the usage. This is a unique feature of MailSlurp that enables you to block the execution and wait for the email you sent to arrive. This is important to avoid race conditions.
Check out our tutorial video series.
Email and SMS guides for automation and testing.
View github project code for multiple languages.
Latest posts from the MailSlurp team.
Test, build, and automate messaging with a free MailSlurp account.