sendmux-sending
Generated Python client for the Sendmux Sending API.
Documentation
- Sending API reference: sendmux.ai/docs/sending-api/introduction
- Source repository: Sendmux/sendmux-sdk
Requirements
- Python 3.10 or newer.
- A send-capable
smx_mbx_*key or owner-approved Sending-resourcesmx_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_clientconfigure_sendingSendmuxSendingApiClient- file helpers:
upload_attachment_from_file,send_email_with_files, and explicit legacyattachment_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.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sendmux_sending-1.6.0.tar.gz | 37.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sendmux_sending-1.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 119.4 kB
Release files / sendmux_sending-1.6.0.tar.gz
| Download URL | sendmux_sending-1.6.0.tar.gz |
|---|---|
| Size | 37.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4218af5036653f629e7ca0441c7a5c43678a5d9358f0e3bf4cf5c31725c64c9e
|
|
BLAKE2b-256 checksum How to use checksums |
fd85e01cb652e8e4a6c96d551467e79e0db332914c3c805cd04fe32b76e80afa
|
| 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 16, 2026.
Transparency logRelease files / sendmux_sending-1.6.0-py3-none-any.whl
| Download URL | sendmux_sending-1.6.0-py3-none-any.whl |
|---|---|
| Size | 81.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
29b8a05fc6aa656105bd5912db5ef20ede43e04f17b96d484ad3bbb4cd63da33
|
|
BLAKE2b-256 checksum How to use checksums |
e2e4d58fbf0a8fafab22287095f05dde186251ac28197f2f6beaf393dcd5da31
|
| 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 16, 2026.
Transparency log