skillfed

mailosaur

The Mailosaur Python library lets you integrate email and SMS testing into your continuous integration process.

mailosaur v8.1.1 127.0K downloads/30d#11,756 on PyPI9
Permissive license MIT Active released

What it is and what it does

Mailosaur is a Python client for the Mailosaur email and SMS testing service. It provides a programmatic interface to retrieve, search, and inspect messages sent to test inboxes—useful for automating verification of password resets, account confirmations, MFA codes, and other transactional communications in CI/CD pipelines. The library handles both email and SMS, automatically extracting verification codes from message bodies and providing access to HTML, plain text, attachments, and hyperlinks.

The package depends on requests for HTTP communication, python-dateutil for timestamp handling, and tzlocal for timezone support. It integrates with the Mailosaur cloud service, so it requires an active account and API key. The library is designed to work with test email addresses under your Mailosaur server domain and supports searching messages by recipient, subject, and other criteria.

Use it for:

  • Automate testing of password-reset email flows in end-to-end test suites.
  • Extract and validate one-time passcodes from SMS or email during account verification tests.
  • Verify that transactional emails are correctly formatted and contain expected content.
  • Test email delivery and content in staging environments without sending to real addresses.
  • Validate HTML and plain-text email rendering as part of continuous integration.
  • Test multi-factor authentication flows that rely on email or SMS delivery.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Mailosaur is a Python client library for automating email and SMS testing, letting you retrieve and inspect messages sent to test inboxes as part of CI/CD workflows.

Yes. Mailosaur is actively maintained, has no known vulnerabilities, and solves a real problem in testing transactional email and SMS flows. Install it if you need to automate email or SMS verification in your test suite. The permissive MIT license and low dependency footprint make it a low-risk addition. The main condition is that you need a Mailosaur account and API key to use it.

Install

mailosaur on PyPI

pip

pip install mailosaur

uv

uv add mailosaur

poetry

poetry add mailosaur

Installing mailosaur

Before you install

Low friction installation with three lightweight runtime dependencies (python-dateutil, tzlocal, requests). The package is actively maintained with a recent release and no known vulnerabilities.

License in practice

MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

pip install mailosaur

from mailosaur import MailosaurClient
from mailosaur.models import SearchCriteria

mailosaur = MailosaurClient()
criteria = SearchCriteria()
criteria.sent_to = "test@abc123.mailosaur.net"
email = mailosaur.messages.get("abc123", criteria)
print(email.subject)

Requires MAILOSAUR_API_KEY environment variable to be set; a Mailosaur account and API key must be obtained from mailosaur.com.

Verify before relying

  • Whether the library fully supports modern Python versions beyond those explicitly listed in classifiers (3.7+).
  • Performance characteristics when handling large volumes of messages or attachments.
  • Whether SMS testing requires additional setup beyond API key configuration.

Package facts

License MIT (permissive)
Python support supports the current Python release (!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7)
Install friction low — pure-Python wheel
Runtime dependencies 3 — python-dateutil, tzlocal, requests
Maintenance actively maintained — 79 days since the last release
Last repo commit
First released
Downloads 127,015/month — #11,756 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mailosaur-8.1.1-py2.py3-none-any.whl

Keywords: email, sms, testing, automation, selenium, robot, framework

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Quality AssuranceTopic :: Software Development :: Testing

Tags

email testing automationsms testing api clienttest email retrievalautomated verification code extractionci/cd email testingfake smtp testingend-to-end email testing
email-testingsms-testingci-cd

More Python Modules packages