TempMail 1.0.0

Temporary email library for .NET (wrapper) based on 1secmail.com API

Install-Package TempMail -Version 1.0.0
dotnet add package TempMail --version 1.0.0
<PackageReference Include="TempMail" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TempMail --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TempMail, 1.0.0"
For F# scripts that support #r syntax, copy this into the source code to reference the package.

.NET TempMail library

Based on 1secmail.com API
Features
  • Create new mailbox(es)
  • Check the mailbox for new emails
  • Fetch an email
  • Wait for an email based on the specified requirement(s)
Add using statement
using TempMail;
Code example
async Task TemporaryEmailDemo()
{
    using (var tempMail = new TemporaryMail())
    {
        var mailbox = await tempMail.GenerateRandomMailbox();

        // Some code eg. await registrationService.Register(mailbox);

        // Email address of the sender has to contain "example.com"
        // and email must not be older than 2 minutes
        var email = await tempMail.WaitForEmail(mailbox,
            x => x.from.Contains("example.com") && DateTime.Now < x.GetDate().AddMinutes(2)
            );

        // Some code eg. parse email body for the activation code / url

        Console.WriteLine(email.body);
    }
}

.NET TempMail library

Based on 1secmail.com API
Features
  • Create new mailbox(es)
  • Check the mailbox for new emails
  • Fetch an email
  • Wait for an email based on the specified requirement(s)
Add using statement
using TempMail;
Code example
async Task TemporaryEmailDemo()
{
    using (var tempMail = new TemporaryMail())
    {
        var mailbox = await tempMail.GenerateRandomMailbox();

        // Some code eg. await registrationService.Register(mailbox);

        // Email address of the sender has to contain "example.com"
        // and email must not be older than 2 minutes
        var email = await tempMail.WaitForEmail(mailbox,
            x => x.from.Contains("example.com") && DateTime.Now < x.GetDate().AddMinutes(2)
            );

        // Some code eg. parse email body for the activation code / url

        Console.WriteLine(email.body);
    }
}

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 51 1/19/2021