Skip to main content

sendmux-sending

PyPI version Python versions PyPI downloads Licence

Generated Python client for the Sendmux Sending API.

Documentation

Requirements

  • Python 3.10 or newer.
  • A send-capable smx_mbx_* key or owner-approved Sending-resource smx_agent_* token.

For OAuth, use a REST access token with the scopes and mailbox access required by the operation. See OAuth for REST APIs.

Installation

pip install sendmux-sending

Connection checks

Check the authenticated team and credential without sending an email:

import os

from sendmux_sending import MetaApi, create_sending_client

with create_sending_client(api_key=os.environ["SENDMUX_SENDING_API_KEY"]) as client:
    connection = MetaApi(client).sending_get_connection()
    print(connection.data.label)

OAuth access tokens

Pass either api_key or access_token. access_token accepts a bare token string or a synchronous callable; the callable is evaluated for each authenticated request. Your application owns token storage, expiry checks and refresh coordination.

import os

from sendmux_sending import create_sending_client

client = create_sending_client(
    access_token=lambda: os.environ["SENDMUX_ACCESS_TOKEN"]
)

Usage

import os

from sendmux_sending import Address, EmailSendRequest, EmailsApi, create_sending_client

client = create_sending_client(api_key=os.environ["SENDMUX_SENDING_API_KEY"])
api = EmailsApi(client)

response = api.sending_send_email(
    EmailSendRequest(
        var_from=Address(email="sender@example.com"),
        to=Address(email="recipient@example.com"),
        subject="Hello from Sendmux",
        html_body="<p>Hello.</p>",
        text_body="Hello.",
    ),
    idempotency_key="email_123",
)

print(response.data.message_id)

The package exports every generated Sending model and API class plus:

  • create_sending_client
  • configure_sending
  • SendmuxSendingApiClient
  • file helpers: upload_attachment_from_file, send_email_with_files, and explicit legacy attachment_from_file

Attachments

For real files, upload bytes first and send with returned attachment_id refs. send_email_with_files does that automatically, so file bytes never enter model context or the JSON send body. Inline base64 remains available only when you intentionally call attachment_from_file for tiny generated content.

import os

from sendmux_sending import create_sending_client, send_email_with_files

client = create_sending_client(api_key=os.environ["SENDMUX_SENDING_API_KEY"])

send_email_with_files(
    client,
    files=["./report.pdf"],
    idempotency_key="report-123",
    body={
        "from": {"email": "sender@example.com"},
        "to": {"email": "recipient@example.com"},
        "subject": "Report",
        "html_body": "<p>Attached.</p>",
    },
)

To upload first and compose the send yourself:

import os

from sendmux_sending import EmailSendRequest, EmailsApi, create_sending_client, upload_attachment_from_file

client = create_sending_client(api_key=os.environ["SENDMUX_SENDING_API_KEY"])
attachment = upload_attachment_from_file(client, file_path="./report.pdf")

EmailsApi(client).sending_send_email(
    EmailSendRequest.from_dict({
        "from": {"email": "sender@example.com"},
        "to": {"email": "recipient@example.com"},
        "subject": "Report",
        "html_body": "<p>Attached.</p>",
        "attachments": [{"attachment_id": attachment.data.attachment_id}],
    })
)

Request helpers

Use sendmux-core when you need explicit idempotency, conditional request, pagination, retry, or typed-error helpers. The generated Sending client already uses the shared retry and error mapper.

Support

Open an issue in Sendmux/sendmux-sdk with the package name, version, and request ID from any API error.

Licence

MIT. See the licence file.

Metadata

Release files for sendmux-sending 1.5.1

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

Source distribution (sdist)

Source distribution for sendmux-sending 1.5.1
File Size Uploaded
sendmux_sending-1.5.1.tar.gz 36.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sendmux-sending 1.5.1
File Interpreter ABI Platform
sendmux_sending-1.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 116.0 kB

Release files / sendmux_sending-1.5.1.tar.gz

Download URL sendmux_sending-1.5.1.tar.gz
Size 36.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4ac3ef43731196ac569f268d3775915de8b42e75e7f15b90c715cd8092b92a8c
BLAKE2b-256 checksum
How to use checksums
3ce4b9303c271c9e6947753089a38247ecad9172ba4cde5cdd1f1abcd5bd0605
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release files / sendmux_sending-1.5.1-py3-none-any.whl

Download URL sendmux_sending-1.5.1-py3-none-any.whl
Size 79.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03f18f90779f8dfd9f9ad6c979fd40ccaa98c50420703f3c8947dad9a5da2d90
BLAKE2b-256 checksum
How to use checksums
0065220976a89072fe581c806e9f4b61fe892aa521d56042a40008d97bed503a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release history Release notifications | RSS feed

1.6.0

2 release files

This release

1.5.1 This release

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

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