Skip to content

resentmail/resent-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Send emails with Python — Resent

PyPI Python versions License Docs

Documentation · Website · PyPI · GitHub

Resent Python SDK

The official Python library for Resent transactional email.

Install

pip install resent

Setup

  1. Verify a sending domain in the Resent dashboard
  2. Create an API key under Settings → API keys
  3. Store it as RESENT_API_KEY
import os
from resent import Resent

resent = Resent(os.environ["RESENT_API_KEY"])

Usage

import os
from resent import Resent

resent = Resent(os.environ["RESENT_API_KEY"])

result = resent.emails.send(
    from_="Acme <noreply@yourdomain.com>",
    to="you@example.com",
    subject="Hello World",
    html="<p>Congrats on sending your <strong>first email</strong> with Resent!</p>",
)

print(result.submission_id)

Send email using HTML

result = resent.emails.send(
    from_="Acme <noreply@yourdomain.com>",
    to=["you@example.com"],
    subject="Hello World",
    html="<strong>It works!</strong>",
)

Send email using text

result = resent.emails.send(
    from_="Acme <noreply@yourdomain.com>",
    to="you@example.com",
    subject="Hello World",
    text="It works!",
)

Docs

License

MIT © Resent

About

Official Python SDK for Resent transactional email

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages