mailtrap
Official mailtrap.io API client
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has minimal dependencies, supports current Python versions, carries no known vulnerabilities, and is MIT-licensed. Install it if you are already using Mailtrap or evaluating it as your email service. Skip it if you need a generic SMTP client or are committed to a different email provider.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later and a valid Mailtrap API token from https://mailtrap.io/api-tokens.
- Low install friction with only two runtime dependencies (requests and pydantic).
- Actively maintained with recent releases; last commit 2026-08-14 and version released 2026-08-04.
License · maintenance · safety
permissive license (permissive) — MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for commercial and open-source projects alike.
last release 2026-08-04 (10 days) · last repo commit 2026-08-14 · 47 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 110,187 downloads/mo, #12,480 on PyPI
Alternatives
Verify before relying
pip install mailtrap
import mailtrap as mt
import os
client = mt.MailtrapClient(token=os.environ["MAILTRAP_API_KEY"])
mail = mt.Mail(
sender=mt.Address(email="sender@example.com", name="John Smith"),
to=[mt.Address(email="recipient@example.com")],
subject="Test",
text="Hello!",
)
client.send(mail)- Rate limits or quota constraints for transactional vs. bulk sending streams.
- Whether the package supports async/await patterns for concurrent email sending.
- Specific retry behavior and timeout defaults for API calls.
What it is and what it does
Mailtrap is the official Python client for Mailtrap's email platform, a service that combines email sending (transactional and bulk streams) with sandbox testing and contact management. It wraps Mailtrap's REST API behind a Pythonic interface, letting you send individual or batch emails, use pre-built templates, manage inboxes and messages in a sandbox environment, and handle contacts and mailing lists. The package depends only on requests for HTTP calls and pydantic for data validation, keeping the installation lightweight.
You use it by instantiating a MailtrapClient with your API token, then constructing Mail or MailFromTemplate objects and calling send() or batch_send(). The client supports switching between sandbox (for testing) and production (for live sending) via configuration flags. It's designed for developers integrating email into Python applications who want a managed service rather than self-hosted SMTP infrastructure.
Use it for
- Send transactional emails (password resets, order confirmations) from a Python web application.
- Test email templates and rendering in a sandbox before deploying to production.
- Manage bulk email campaigns with template variables and contact lists.
- Validate email content and HTML/CSS compliance using Mailtrap's testing sandbox.
- Integrate email sending into a Django, FastAPI, or Flask application without configuring SMTP.
- Batch-send personalized emails to multiple recipients with template substitution.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has minimal dependencies, supports current Python versions, carries no known vulnerabilities, and is MIT-licensed. Install it if you are already using Mailtrap or evaluating it as your email service. Skip it if you need a generic SMTP client or are committed to a different email provider.
Install
mailtrap on PyPI
Before you install
Low install friction with only two runtime dependencies (requests and pydantic). Actively maintained with recent releases; last commit 2026-08-14 and version released 2026-08-04. Supports current Python versions (3.9+).
Requires Python 3.9 or later and a valid Mailtrap API token from https://mailtrap.io/api-tokens.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for commercial and open-source projects alike.
Quickstart
pip install mailtrap
import mailtrap as mt
import os
client = mt.MailtrapClient(token=os.environ["MAILTRAP_API_KEY"])
mail = mt.Mail(
sender=mt.Address(email="sender@example.com", name="John Smith"),
to=[mt.Address(email="recipient@example.com")],
subject="Test",
text="Hello!",
)
client.send(mail)
Verify before relying
- Rate limits or quota constraints for transactional vs. bulk sending streams.
- Whether the package supports async/await patterns for concurrent email sending.
- Specific retry behavior and timeout defaults for API calls.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesrequestspydantic |
| Maintenance | Actively maintained 10 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 110,187 / month, #12,480 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Application Frameworks |
Evidence: mailtrap-2.7.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “mailtrap email client”
- mailtrapOfficial Python client for Mailtrap's email sending and testing APIs,…
- resendResend Python SDK provides a client library for sending emails…
- neverbounce-sdkPython client library for the NeverBounce email verification API v4,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Application Frameworks packages
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Textual is a Python framework for building cross-platform user interfaces that run in the terminal or web browser using a modern, component-based API.
Install it if you're developing CLI tools, dashboards, or interactive terminal applications.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Build and connect to Model Context Protocol servers that expose tools, resources, and prompts to LLM applications over stdio, HTTP, or SSE transports.
Install it if you need to build or connect to servers.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
See also django-anymail · mailslurp-client · neverbounce-sdk · postmarker · sendsafely · mailgun · resend · mailchimp-transactional · smsapi-client · redmail