Coder Social home page Coder Social logo

ryuzakih / temp-mail-api Goto Github PK

View Code? Open in Web Editor NEW
37.0 3.0 5.0 290 KB

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

License: MIT License

C# 100.00%
tempmail api client-library csharp c-sharp mail email temporary temp-mail client

temp-mail-api's Introduction

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

temp-mail-api's People

Contributors

angelgzs avatar ryuzakih avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

temp-mail-api's Issues

TempMail Ban my ip

Temp mail will ban any ip if u send much requests :(
Can u add Proxy Option Please <3
Thank You.

Response status code: 503

HttpRequestException: Response status code does not indicate success: 503 (Service Temporarily Unavailable).

any help ?

Enquery about installation

I was trying to install with Install-Package TempMail.API cmd in powershell (normal as well as admin), it didn't work.
Actually, I'm quite new to C#.

This is the attachment.

image

How to get past this?
Any help..
(PS: I haven't cloned or downloaded the repo files)

Error

Hello!
I use this:

     var client = TempMailClient.Create();
            Console.WriteLine(client.Email);

And I Get error:

Необработанное исключение: System.AggregateException: Произошла одна или несколько ошибок. ---> System.FormatException: Формат значения "<null>" недопустим.
   в System.Net.Http.Headers.HttpHeaderParser.ParseValue(String value, Object storeValue, Int32& index)
   в System.Net.Http.Headers.HttpHeaders.ParseAndAddValue(String name, HeaderStoreItemInfo info, String value)
   в System.Net.Http.Headers.HttpHeaders.Add(String name, String value)
   в CloudflareSolverRe.CloudflareSolver.<>c__DisplayClass30_0.<<Solve>b__0>d.MoveNext()
--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---
   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   в CloudflareSolverRe.Utilities.SemaphoreLocker.<LockAsync>d__1`1.MoveNext()
--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---
   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   в CloudflareSolverRe.CloudflareSolver.<Solve>d__30.MoveNext()
--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---
   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   в CloudflareSolverRe.ClearanceHandler.<GetClearance>d__24.MoveNext()
--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---
   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   в CloudflareSolverRe.ClearanceHandler.<SendAsync>d__20.MoveNext()
   --- Конец трассировки внутреннего стека исключений ---
   в System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   в System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   в System.Threading.Tasks.Task`1.get_Result()
   в TempMail.API.Extensions.HttpClientExtensions.GetString(HttpClient client, String requestUri)
   в TempMail.API.TempMailClient.StartSession()
   в TempMail.API.TempMailClient.Create(ICaptchaProvider captchaProvider, IWebProxy proxy)
   в ConsoleApp22.Program.GetEmail() в C:\Users\Антон\source\repos\ConsoleApp22\ConsoleApp22\Program.cs:строка 42
   в ConsoleApp22.Program.Main(String[] args) в C:\Users\Антон\source\repos\ConsoleApp22\ConsoleApp22\Program.cs:строка 19

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.