Skip to content

Unofficial API Client Library for temp-mail.org in .NET Standard

License

Notifications You must be signed in to change notification settings

RyuzakiH/Temp-Mail-API

Repository files navigation

Temp-Mail-API AppVeyor NuGet

Unofficial API Client Library for TempMail in .NET Standard

Disposable email - is a service that allows to receive email at a temporary address that self-destructed after a certain time elapses. It is also known by names like : tempmail, 10minutemail, throwaway email, fake-mail or trash-mail. Many forums, Wi-Fi owners, websites and blogs ask visitors to register before they can view content, post comments or download something. Temp-Mail - is most advanced throwaway email service that helps you avoid spam and stay safe.

Installation

PM> Install-Package TempMail.API

Usage

  • Initialize Client

Creates and initializes a new temp-mail client with a temporary email

var client = TempMailClient.Create();
var client = await TempMailClient.CreateAsync();
  • Current Email

Gets current temporary email

var email = client.Email;
  • Available Domains

Gets available domains

var availableDomains = client.AvailableDomains;
  • Change Email

Changes the temporary email to a specific email (ex: login@domain)

client.ChangeEmail("loginexample", availableDomains[0]);
await client.ChangeEmailAsync("loginexample", availableDomains[0]);
  • Delete

Deletes the temporary email and gets a new one

client.Delete();
await client.DeleteAsync();
  • Refresh

Gets all mails in mailbox

var mails = client.Inbox.Refresh();
var mails = await client.Inbox.RefreshAsync();
  • Mailbox

Gets all mails in mailbox (doesn't update from temp-mail)

var mails = client.Inbox.Mails;
  • Inbox Auto Check

Checks for incoming mails every period of time

client.StartAutoCheck(delay: 10000); // default delay is 10s
client.StopAutoCheck();
  • Events

Occurs when the temporary email changes

client.EmailChanged += (o, e) => Console.WriteLine($"Email changed: {e.Email}");

Occurs when a new mail is received by client

client.Inbox.NewMailReceived += (o, e) => Console.WriteLine($"\tSender: {e.Mail.SenderName}\n\tSubject: {e.Mail.Subject}\n\tBody: {e.Mail.TextBody}");

Additional Features

  • Cloudflare Protection

Website sometimes uses Cloudflare protection, so we use CloudflareSolverRe to bypass it.

Sometimes Cloudflare forces captcha challenges or Js challenge cannot be solved, so we need to use CloudflareSolverRe.Captcha package to bypass it using (2captcha or AntiCaptcha)

var client = TempMailClient.Create(
    captchaProvider: new AntiCaptchaProvider("YOUR_API_KEY"));
var client = TempMailClient.Create(
    captchaProvider: new TwoCaptchaProvider("YOUR_API_KEY"));

for more information read the documentation here CloudflareSolverRe

  • Proxy

var client = TempMailClient.Create(
    proxy: new WebProxy("163.172.220.221", 8888));

Full Examples Here

Supported Platforms

.NET Standard 1.3

Dependencies