v1.1.0 — Released 2026-07-02 | Release Notes | Changelog
C#/.NET wrapper for 16 temporary email services. Zero API keys. Uses
HttpClient+System.Text.Json.
- .NET 8.0+
System.Text.Json(included in framework, zero third-party dependencies)
dotnet pack TempMail/TempMail.csproj -c Release
dotnet add package TempMail --source ./nupkgOr reference directly:
<ProjectReference Include="path/to/TempMail/TempMail.csproj" />Copy .env.example to .env and fill in your values:
cp .env.example .env| Variable | Required | Description |
|---|---|---|
RESEND_API_KEY |
For E2E tests | Resend API key for test email delivery. Get at resend.com. |
using TempMail;
var provider = TempMailFactory.Create("mail.tm");
var email = await provider.GenerateEmailAsync();
Console.WriteLine($"Email: {email}");
var message = await provider.WaitForEmailAsync(email,
TimeSpan.FromMinutes(2), TimeSpan.FromSeconds(5));
if (message is not null)
{
Console.WriteLine($"From: {message.Sender}");
Console.WriteLine($"Subject: {message.Subject}");
}Dropmail requires solving a captcha to create sessions. You can provide a chain of solver functions — each is tried in order until one returns text.
Default: Built-in PaddleOCR via HuggingFace space (no config needed).
using TempMail.Providers;
using System.IO;
using System.Collections.Generic;
// Default: uses PaddleOCR via HuggingFace
var dropmailDefault = new DropmailProvider(httpClient);
// Manual solver: show image, user types text
Func<byte[], string> manualSolver = imgBytes => {
File.WriteAllBytes("captcha.png", imgBytes);
Console.Write("Enter captcha text: ");
return Console.ReadLine();
};
// External service (e.g., 2captcha)
Func<byte[], string> externalSolver = imgBytes => {
// Upload to 2captcha API, wait for result
// Return the solved text or null on failure
return null;
};
// Chain: try external first, then PaddleOCR, then manual
var dropmail = new DropmailProvider(httpClient, new List<Func<byte[], string>> {
externalSolver,
DropmailProvider.PaddleOcrSolver,
manualSolver
});Each solver receives the captcha image as byte[] and returns string. Return null to pass to the next solver in the chain.
| Provider | Factory Name | Requires API Key | Notes |
|---|---|---|---|
| Mail.tm | mail.tm |
No | Account-based |
| GuerrillaMail | guerrillamail |
No | Session cookies |
| YOPmail | yopmail |
No | HTML scraping |
| Dropmail.me | dropmail |
No | GraphQL |
| 1secemail | 1secemail |
No | REST API |
| Provider | Factory Name | Requires API Key | Notes |
|---|---|---|---|
| emailfake | emailfake |
No | HTML scraping, surl cookie |
| generator.email | generator.email |
No | HTML scraping, surl cookie |
| email-temp.com | email-temp |
No | HTML scraping, surl cookie |
| zoromail | zoromail |
No | REST API |
| tempmail.lol | tempmail.lol |
No | REST API, token-based |
| tempmailc | tempmailc |
No | REST API |
| temp-mail.io | temp-mail.io |
No | REST API, Bearer token |
| tempmail.plus | tempmail.plus |
No | REST API, email query |
| mailnesia | mailnesia |
No | HTML scraping (rate-limited) |
| 10minutemail | 10minutemail |
No | REST API, cookie session |
| ncaori | ncaori |
No | REST API (nca.my.id) |
All providers implement ITempMailProvider (via TempMailFactory.Create()):
| Method | Description |
|---|---|
GenerateEmailAsync(ct) |
Create a new temporary email address |
GetInboxAsync(email, ct) |
List messages for an address |
ReadMessageAsync(messageId, ct) |
Get full message content |
DeleteEmailAsync(email, ct) |
Delete the email/account |
WaitForEmailAsync(email, timeout, interval, ct) |
Poll until first email arrives |
Message:Id,Sender,Subject,DateMessageDetailextendsMessage:BodyText,BodyHtml,Attachments
All extend TempMailException:
RateLimitException— HTTP 429, hasRetryAfterpropertyNotFoundException— HTTP 404
dotnet test TempMail.Tests/Real HTTP calls against live APIs. No mocks. See TEST_REPORT.md for latest results.
E2E tests use Resend API to send test emails. Set RESEND_API_KEY in .env before running.
See examples/ directory.
TEST_REPORT.md— latest test results../README.md— project-wide README../ARCHITECTURE.md— cross-language architecture../CONTRIBUTING.md— how to add providers
Apache License 2.0 — see ../LICENSE and ../NOTICE.