Metadata-Version: 2.4
Name: emercury-smtp-sdk
Version: 1.0.1
Summary: Official Python SDK for the Emercury SMTP API
Author-email: Emercury <support@emercury.net>
License-Expression: MIT
Project-URL: Homepage, https://www.emercury.net
Keywords: emercury,smtp,email,transactional-email,api-client,sdk
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Typing :: Typed
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: urllib3<3.0.0,>=2.1.0
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: pydantic<3.0,>=2.11
Requires-Dist: typing-extensions>=4.7.1
Provides-Extra: dev
Requires-Dist: pytest<10.0,>=8.0; extra == "dev"
Dynamic: license-file

# Emercury SMTP SDK for Python

The official Python client for sending transactional email and reading outbound delivery statistics through the
stable Emercury SMTP API.

## Installation

```bash
pip install emercury-smtp-sdk
```

## Send an email

```python
import os
import uuid

from emercury_smtp_sdk import (
    ApiClient,
    Configuration,
    EmailAddress,
    EmailApi,
    EmailContentPart,
    EmailContentType,
    SendEmailRequest,
)

configuration = Configuration()
configuration.api_key["ApiTokenAuth"] = os.environ["EMERCURY_API_TOKEN"]

email = SendEmailRequest(
    var_from=EmailAddress(email="sender@example.com", name="Example"),
    to=EmailAddress(email="recipient@example.net"),
    subject="Hello from Emercury",
    contents=[EmailContentPart(
        content_type=EmailContentType.TEXT_SLASH_PLAIN,
        content="Your transactional email is ready.",
    )],
)

with ApiClient(configuration) as api_client:
    result = EmailApi(api_client).send_email(
        email,
        idempotency_key=str(uuid.uuid4()),
    )
```

Use a unique idempotency key when a send may be retried. The same key and normalized payload return the original
response for 24 hours; reusing a key with a different payload returns `409 Conflict`.
