SmorcIRL.TempMail 2.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package SmorcIRL.TempMail --version 2.0.2                
NuGet\Install-Package SmorcIRL.TempMail -Version 2.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SmorcIRL.TempMail" Version="2.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SmorcIRL.TempMail --version 2.0.2                
#r "nuget: SmorcIRL.TempMail, 2.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SmorcIRL.TempMail as a Cake Addin
#addin nuget:?package=SmorcIRL.TempMail&version=2.0.2

// Install SmorcIRL.TempMail as a Cake Tool
#tool nuget:?package=SmorcIRL.TempMail&version=2.0.2                

mail.tm

A mail.tm / mail.gw API wrapper for .NET. These services currently have identical APIs, but this may change in the future.

Installation

Available as a NuGet.

PM> Install-Package SmorcIRL.TempMail

Getting started

Introduction

mail.tm is a great temporary/disposable mail service, and recently a new 10 minute mail service called mail.gw was also launched. As I said, these two services have identical API's, so everything said about mail.tm will also apply to mail.gw (at least it was the last time I compared Swagger configs). Basically all API calls require authorisation, but some do not (e.g. getting domain info). If you have an authorised MailClient instance, you can get its authorisation token via the BearerToken property, which can be useful for manual debugging using Swagger.

Register

Interaction with account API is performed through a MailClient instance. You can simply register like this

MailClient client = new MailClient();
await client.Register("pepethefrog@sad.me", "*password*");

You can also specify the base api url. The default refers to mail.tm, but if you want to use mail.gw, create a client like this

MailClient client = new MailClient(new Uri("https://api.mail.gw/"));

Make sure you specify the domain correctly - the list of domains is limited by the service. You can get an up-to-date list using

DomainInfo[] domains = await client.GetAvailableDomains();

If you just need to get any valid domain name for your account

string domain = await client.GetFirstAvailableDomainName();

There is also an option to generate a new account. Note that it won't be possible to recover the password if you omit it.

await client.GenerateAccount("*optional_password*");

Log in

If you already have an account, you can log in using your creds

await client.Login("pepethefrog@sad.me", "*password*");

If you have an auth token, you can use it instead

await client.LoginWithToken("*token*");

Get account info

If you need to get info about the account you are using, such as creation date or message quota, call

AccountInfo info = await client.GetAccountInfo();

Delete account

Once you are finished with the account, you can delete it

await client.DeleteAccount();

After that you can reuse the client instance with a new authorisation via Login()/Register() if needed.

Working with messages

  • Get info about all messages
MessageInfo[] messages = await client.GetAllMessages();
  • Get info about all messages from the page
MessageInfo[] messages = await client.GetMessages(*page*);
  • Get message info by id
MessageInfo message = await client.GetMessage("*id*");
  • Get message source
MessageSource source = await client.GetMessageSource("*id*");
string rawMessage = source.Data;
  • Mark as seen
await client.MarkMessageAsSeen("*id*", true);
  • Delete
await client.DeleteMessage("*id*");
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.1 is compatible.  netstandard1.2 was computed.  netstandard1.3 was computed.  netstandard1.4 was computed.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 was computed.  netstandard2.1 was computed. 
.NET Framework net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 was computed. 
Windows Phone wpa81 was computed. 
Windows Store netcore was computed.  netcore45 was computed.  netcore451 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.0 4,756 7/6/2024
2.0.2 3,432 9/30/2023
2.0.1 15,883 2/23/2022
2.0.0 635 1/26/2022
1.0.2 496 8/21/2021
1.0.1 341 8/21/2021
1.0.0 315 8/21/2021