Skip to main content

Official Python SDK for the Emercury SMTP API

Project description

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

pip install emercury-smtp-sdk

Send an email

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

emercury_smtp_sdk-1.0.1.tar.gz (31.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

emercury_smtp_sdk-1.0.1-py3-none-any.whl (75.0 kB view details)

Uploaded Python 3

File details

Details for the file emercury_smtp_sdk-1.0.1.tar.gz.

File metadata

  • Download URL: emercury_smtp_sdk-1.0.1.tar.gz
  • Upload date:
  • Size: 31.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for emercury_smtp_sdk-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e03555464b4ca0ef74d8456862f6ca264ffa250c5f802353081caa1f629a8969
MD5 224f466668b518a0545367227b067ff6
BLAKE2b-256 f5253b5f4d964c2a0d2d75bec3c21e887a1181afae32925c90d8022d68e77d1a

See more details on using hashes here.

File details

Details for the file emercury_smtp_sdk-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for emercury_smtp_sdk-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f15a1deaaee64a6e62bac1e38a9ed05f7b6852d2df7dd882479fa0e754c5878d
MD5 90e5d13336d307425f27a10dd2196627
BLAKE2b-256 66579ad857ac04b35148131ca4cd8163757e71c656122be7ff70ef2b9d3f3795

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page