Overview

mail.tm offers a temporary email service accessible via a web interface and a programmatic API. The platform is designed for scenarios requiring a transient email address, such as testing application signup flows, verifying email functionality during development, or registering for services without exposing a personal email address. The core functionality includes the ability to generate a new, unique email address and then retrieve emails sent to that address.

The service operates by providing a temporary domain and an associated mailbox that becomes active upon creation. Developers can use the mail.tm API to automate the creation of these addresses, poll for incoming emails, and extract relevant information such as sender, subject, and body content. This automation capability is suitable for continuous integration (CI) environments where email verification steps are part of a test suite.

For individuals, mail.tm can serve as a defense against unsolicited commercial email (spam) by providing an address that can be discarded after use. This approach helps maintain the privacy of primary email accounts, which aligns with common recommendations for online privacy practices, as described by organizations such as Mozilla Developer Network on related privacy topics.

The API is stateless for generating new addresses but maintains a temporary state for each mailbox to store incoming messages. Messages are typically stored for a limited duration before being automatically cleaned up. This ephemeral nature is central to the service's design, ensuring that mailboxes do not accumulate unnecessary data and remain temporary. The API provides endpoints for various operations, including account creation, domain listing, message retrieval, and individual message details, catering to a range of programmatic email handling needs.

mail.tm's simple API structure aims to reduce the overhead associated with setting up and managing email accounts for short-term tasks. It supports various programming languages through standard HTTP requests, making it accessible to developers working in different environments. The service differentiates itself by offering a fully featured free tier, providing complete API and web access without financial cost, which positions it as a practical choice for developers and users requiring disposable email solutions without budget constraints.

Key features

  • Temporary Email Generation: Create on-demand, unique email addresses for immediate use and later disposal.
  • Email Retrieval API: Programmatically fetch incoming emails, including sender, subject, and content, via HTTP requests (mail.tm documentation).
  • Domain Listings: Access a list of available temporary domains to generate email addresses under, allowing for some customization or regional preference.
  • Message Management: Retrieve specific message details and manage the lifecycle of temporary mailboxes, though messages are automatically purged after a set period.
  • Cross-Language Support: API examples and documentation cater to common programming languages like PHP, JavaScript, Python, and cURL for broad developer accessibility.
  • Spam Prevention: Offers a mechanism to avoid exposing primary email addresses to third-party services, reducing the likelihood of receiving unwanted spam.
  • Application Testing: Facilitates automated testing of email-dependent features in applications, such as user registration and password reset workflows.

Pricing

As of May 28, 2026, mail.tm operates on a free pricing model, offering full access to its API and web features without charge. This approach positions it as an accessible option for developers and users requiring temporary email services without financial commitment.

Feature Free Tier
API Access Full
Web Access Full
Email Address Generation Unlimited
Email Retrieval Unlimited
Support Community-based (implied)

For the most current pricing information and feature details, refer to the official mail.tm homepage.

Common integrations

mail.tm's API can be integrated into various development workflows and applications, primarily where temporary email functionality is required. Specific pre-built integrations are not extensively documented, but its RESTful API design allows for custom integration with:

  • Testing Frameworks: Use in conjunction with automated testing suites (e.g., Selenium, Playwright, Cypress) for verifying email functionality in web applications during CI/CD pipelines.
  • Development Environments: Integrate into custom scripts or local development server setups to handle email verification during the development phase.
  • Backend Services: Incorporate into server-side logic (e.g., Node.js, Python Flask/Django, PHP Laravel) to create and manage temporary email accounts for specific application needs.
  • Scraping Tools: Employ in web scraping projects where temporary email sign-ups are necessary to access content or bypass restrictions.
  • Bot Development: Utilize for creating automated bots that require email verification for account creation on various platforms.

Developers can refer to the mail.tm API documentation for detailed instructions on making API calls and integrating with custom applications.

Alternatives

Several services offer similar temporary or disposable email functionalities, catering to different use cases and offering varying feature sets:

  • Temp Mail: A popular service for disposable email addresses, often used for one-time registrations and spam avoidance.
  • Guerrilla Mail: Provides a secure, disposable email address with an emphasis on privacy and anonymity, including an API for programmatic access (e.g., Guerrilla Mail how-to).
  • 10 Minute Mail: Generates a temporary email address that self-destructs after ten minutes, ideal for very short-term needs.
  • Mailinator: Offers public and private domains for testing email workflows, often used in QA and development environments.
  • YOPmail: Provides disposable inboxes without registration, focusing on privacy and anti-spam measures.

Getting started

To get started with mail.tm, you first need to create a temporary account and then retrieve emails. Here's an example using Python to create an account, get its ID, and then fetch messages:

import requests
import time

BASE_URL = "https://api.mail.tm"

def create_account(address, password):
    url = f"{BASE_URL}/accounts"
    headers = {"Content-Type": "application/json"}
    data = {"address": address, "password": password}
    response = requests.post(url, json=data)
    response.raise_for_status()
    return response.json()

def get_token(address, password):
    url = f"{BASE_URL}/token"
    headers = {"Content-Type": "application/json"}
    data = {"address": address, "password": password}
    response = requests.post(url, json=data)
    response.raise_for_status()
    return response.json()["token"]

def get_messages(token, account_id):
    url = f"{BASE_URL}/messages"
    headers = {"Authorization": f"Bearer {token}"}
    response = requests.get(url, headers=headers)
    response.raise_for_status()
    return response.json()

# Example Usage
try:
    # 1. Create a unique email address
    # mail.tm requires a unique email, so we generate one.
    timestamp = int(time.time())
    temp_email_address = f"testuser{timestamp}@mail.tm"
    temp_password = "StrongPassword123!"

    print(f"Creating account: {temp_email_address}")
    account_info = create_account(temp_email_address, temp_password)
    account_id = account_info["id"]
    print(f"Account created with ID: {account_id}")

    # 2. Get authentication token for the account
    auth_token = get_token(temp_email_address, temp_password)
    print(f"Authentication token obtained.")

    # You would typically send an email to temp_email_address here
    # For this example, we'll just check for existing messages.
    print("Waiting for potential incoming emails... (e.g., after sending one to this address)")
    time.sleep(10) # Wait a bit for an email to potentially arrive

    # 3. Retrieve messages for the account
    messages = get_messages(auth_token, account_id)
    if messages:
        print(f"Found {len(messages)} message(s):")
        for msg in messages:
            print(f"  Subject: {msg['subject']}")
            print(f"  From: {msg['from']['address']}")
            # print(f"  Body: {msg['text']}") # Uncomment to see full text body
            print("---------------------")
    else:
        print("No messages found yet.")

except requests.exceptions.HTTPError as e:
    print(f"HTTP Error occurred: {e.response.status_code} - {e.response.text}")
except Exception as e:
    print(f"An error occurred: {e}")

This Python script demonstrates the basic flow:

  1. Create Account: A POST request to /accounts with a generated email address and a password creates a new temporary mailbox.
  2. Get Token: A subsequent POST request to /token authenticates with the new account's credentials and retrieves an access token, which is required for fetching messages.
  3. Get Messages: A GET request to /messages, including the bearer token in the Authorization header, fetches all emails currently in the temporary inbox.

For more detailed API usage and examples in other languages, refer to the official mail.tm documentation.