Skip to main content

SendGrid using a client based on httpx.

Project description

Python Python
Package PyPI Latest Release PyPI Downloads
Meta License - MIT


Sendgrid simple asynchronous client based on the httpx libarary.


It is possible to install async-sendgrid with pip:

pip install async-sendgrid


This is a small script showing how to send an email with async-sendgrid:

First, you need to import the SendgridAPI from the async_sendgrid package. Then, you need to create a SendgridAPI object with your API key.

from async_sendgrid import SendgridAPI
import os

API_KEY = os.environ.get['API_KEY']
sendgrid = SendgridAPI(API_KEY)

Thereafter, you can create an email with the original sendgrid package such:

from sendgrid.helpers.mail import Content, Email, Mail, To

from_email = Email("")
to_email = To("")
subject = "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
content = Content("text/plain", "Sed varius ligula ac urna vehicula ultrices. Nunc ut dolor sem.")

mail = Mail(

Finally you can send the email with the send method of the SendgridAPI instance:

async with sendgrid as client:
    response = await client.send(data)

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

sendgrid_async-1.0.1.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

sendgrid_async-1.0.1-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

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