Skip to main content

mailofly

Official Python client for the Mailofly REST API.

Requires Python 3.9+.

Source of truth: developed in the mailofly monorepo under packages/python. This public repo is mirrored automatically on change.

Install

pip install mailofly

Usage

import os
from mailofly import Mailofly, MailoflyError

client = Mailofly(os.environ["MAILOFLY_API_KEY"])

try:
    result = client.emails.send({
        "from": "Acme <onboarding@example.com>",
        "to": ["you@example.com"],
        "subject": "Hello",
        "html": "<p>Hi from Mailofly</p>",
    })
    print(result["id"])
except MailoflyError as e:
    print(e.status, e.error, e.detail_message)

# Batch (up to 100 emails)
batch = client.batch.send([
    {"from": "Acme <onboarding@example.com>", "to": ["a@b.com"], "subject": "Hi", "html": "<p>1</p>"},
    {"from": "Acme <onboarding@example.com>", "to": ["c@d.com"], "subject": "Hi", "html": "<p>2</p>"},
])
print(batch["data"])

Docs

Releasing

  1. Bump version in pyproject.toml (and this changelog) in the monorepo PR.
  2. Merge to main/master → GitHub Action syncs this folder to teamredevs/mailofly-python.
  3. Publish workflow runs and publishes to PyPI only when the version is new.

License

MIT

Metadata

Release files for mailofly 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mailofly 0.2.0
File Size Uploaded Provenance
mailofly-0.2.0.tar.gz 5.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mailofly 0.2.0
File Interpreter ABI Platform
mailofly-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.8 kB

Release files / mailofly-0.2.0.tar.gz

Download URL mailofly-0.2.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
84cef2eac3cf3af085860a09495b3b94f74792d7be18ada3ef39c6f69b23623e
BLAKE2b-256 checksum
How to use checksums
ef8f3494379e60397e212952cea592e8f7cbee9f670eefe34515e6cc0556f2d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release files / mailofly-0.2.0-py3-none-any.whl

Download URL mailofly-0.2.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
646726b0d2907bb1bd0d50d32650407b795986dffe5d8663ba87e83edc38e577
BLAKE2b-256 checksum
How to use checksums
16a8ba7e9eb5b2cf00b754b4bac97112aa8bc9b7ac72cf8faa0a4ee3ca482e74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Security for mailofly 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page