Skip to main content

serversmtp (Python)

Official Python SDK for the ServerSMTP transactional email API. Python 3.9+, standard library only.

pip install serversmtp
import os
from serversmtp import ServerSMTP, ServerSMTPError

serversmtp = ServerSMTP(os.environ["SERVERSMTP_API_KEY"])

response = serversmtp.emails.send(
    {
        "from": "Shop <orders@your-domain.ro>",
        "to": "customer@example.com",
        "subject": "Order #1001 confirmed",
        "html": "<p>Thank you!</p>",
    },
    idempotency_key="order-1001-confirmation",
)
print(response.data["status"], response.idempotency_key)

Attachments, CC and BCC (up to 10 files, 10 MB in total; each address counts toward the quota):

from serversmtp import attachment_from_path

serversmtp.emails.send({
    "from": "Shop <orders@your-domain.ro>",
    "to": "customer@example.com",
    "cc": "accounting@your-domain.ro",
    "bcc": ["archive@your-domain.ro"],
    "subject": "Invoice #1001",
    "text": "Your invoice is attached.",
    "attachments": [attachment_from_path("invoice-1001.pdf")],
})
  • emails.send(), emails.send_batch(), emails.schedule() (timezone-aware datetime for sendAt)
  • scheduled.list(), scheduled.get(), scheduled.cancel(), verify_api_key()
  • events.trigger(event, email, data=None, phone=None, audience_id=None) starts the automations for an event (email and SMS steps):
serversmtp.events.trigger("comanda.expediata", "client@example.com",
                          {"order_reference": "1001", "tracking_number": "AWB123"}, phone="0722 123 456")
  • Errors raise ServerSMTPError with status_code, fields, request_id and type.

Docs: https://serversmtp.ro/docs#biblioteci

Metadata

Release files for serversmtp 0.3.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 serversmtp 0.3.0
File Size Uploaded Provenance Actions
serversmtp-0.3.0.tar.gz 6.6 kB Without provenance Details for serversmtp-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 11.4 kB

Release files / serversmtp-0.3.0.tar.gz

Download URL serversmtp-0.3.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c5f4c75563fa2dcf7dedb42a87c10f95e451d1b28a70c5127c681b69d585a18c
BLAKE2b-256 checksum
How to use checksums
f03e133331e3b1e852ed5d50a82ad16f57a4f4b0ed28aedbd210251fdd96a222
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / serversmtp-0.3.0-py3-none-any.whl

Download URL serversmtp-0.3.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6ffc04ab61ae0873099e0a30ed920e9dc84b0dd884713b7a5859e48ae13668b
BLAKE2b-256 checksum
How to use checksums
b8634f5baf6f21b36e17bcf010dd8e85c8ea17898547ca672c99c714f9266255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for serversmtp 0.3.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.3.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