Skip to main content

Resend Python SDK

Code style: black Build codecov License: MIT PyPI PyPI - Python Version


Installation

To install Resend Python SDK, simply execute the following command in a terminal:

pip install resend

Setup

First, you need to get an API key, which is available in the Resend Dashboard.

import resend
import os

resend.api_key = "re_yourkey"

Example

You can get an overview about all parameters in the Send Email API reference.

import os
import resend

resend.api_key = "re_yourkey"

params: resend.Emails.SendParams = {
    "from": "onboarding@resend.dev",
    "to": ["delivered@resend.dev"],
    "subject": "hi",
    "html": "<strong>hello, world!</strong>",
    "reply_to": "to@gmail.com",
    "bcc": "bcc@resend.dev",
    "cc": ["cc@resend.dev"],
    "tags": [
        {"name": "tag1", "value": "tagvalue1"},
        {"name": "tag2", "value": "tagvalue2"},
    ],
}

email: resend.Emails.SendResponse = resend.Emails.send(params)
print(email)

Async Support

The SDK supports async operations via httpx. Install the async extra:

pip install resend[async]

Once installed, async methods (suffixed with _async) work automatically — no extra setup needed:

import asyncio
import resend

resend.api_key = "re_yourkey"

async def main():
    params: resend.Emails.SendParams = {
        "from": "onboarding@resend.dev",
        "to": ["delivered@resend.dev"],
        "subject": "hi",
        "html": "<strong>hello, world!</strong>",
    }

    email: resend.Emails.SendResponse = await resend.Emails.send_async(params)
    print(email)

if __name__ == "__main__":
    asyncio.run(main())

Custom async client

To use a custom async HTTP client or configure options like timeouts, set resend.default_async_http_client:

import resend

resend.api_key = "re_yourkey"
resend.default_async_http_client = resend.HTTPXClient(timeout=60)

Download files

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

Source Distribution

resend-2.46.0.tar.gz (61.3 kB view details)

Uploaded Source

Built Distribution

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

resend-2.46.0-py2.py3-none-any.whl (93.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file resend-2.46.0.tar.gz.

File metadata

  • Download URL: resend-2.46.0.tar.gz
  • Upload date:
  • Size: 61.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for resend-2.46.0.tar.gz
Algorithm Hash digest
SHA256 db0ca26d9f46921082ccf28cf6a894b26a5287b003380cfb5039a7bc66d3b797
MD5 b4e17a59926a9c07f337fd96f56d45b4
BLAKE2b-256 c17e96256ea9ae076b90e20e8c435a001281e1ff884467e0597d4245c769edf3

See more details on using hashes here.

Provenance

The following attestation bundles were made for resend-2.46.0.tar.gz:

Publisher: release.yml on resend/resend-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file resend-2.46.0-py2.py3-none-any.whl.

File metadata

  • Download URL: resend-2.46.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 93.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for resend-2.46.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cb43ce303c6828c7a35912d9bc6b305e2b5870634b8256cf04af8ab76158633a
MD5 cfa2cb752e190da000a1ca55a19cdccb
BLAKE2b-256 db2fa20a11e2a398766ae51d6406cf49228a913dbd935ebe4f34acf8f07918c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for resend-2.46.0-py2.py3-none-any.whl:

Publisher: release.yml on resend/resend-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2.46.0 This release

2 files

2.45.1

2 files

2.45.0

2 files

2.44.0

2 files

2.43.0

2 files

2.42.0

2 files

2.41.0

2 files

2.40.2

2 files

2.40.1

2 files

2.40.0

2 files

2.39.0

2 files

2.38.0

2 files

2.37.0

2 files

2.36.0

2 files

2.35.0

2 files

2.34.0

2 files

2.33.0

2 files

2.32.2

2 files

2.32.1

2 files

2.32.0

2 files

2.31.0

2 files

2.30.1

2 files

2.30.0

2 files

2.29.0

2 files

2.28.1

2 files

2.28.0

2 files

2.27.0

2 files

2.26.0

2 files

2.25.0

2 files

2.24.0

2 files

2.23.0

2 files

2.22.0

2 files

2.21.0

2 files

2.19.0

2 files

2.18.0

2 files

2.17.0

2 files

2.16.0

2 files

2.15.0

2 files

2.14.0

2 files

2.13.1

2 files

2.13.0

2 files

2.12.0

2 files

2.11.0

2 files

2.10.0

2 files

2.9.0

2 files

2.8.0

2 files

2.7.0

2 files

2.6.0

2 files

2.5.1

2 files

2.4.0

2 files

2.3.0

2 files

2.2.0

2 files

2.1.0

2 files

2.0.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.8.0

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.2

1 file

0.5.1

1 file

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 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