Skip to main content

Simple wrapper to use SendGrid SMTP API

Project description

SendGrid Logo

Travis Badge Email Notifications Badge Twitter Follow Codecov branch Python Versions PyPI Version GitHub contributors MIT Licensed

This module helps build SendGrid’s SMTP API headers.

Learn more about the SMTP API at SendGrid documentation.


The default branch name for this repository has been changed to `main` as of 07/27/2020.

All the updates to this module are documented in our CHANGELOG.



  • Python version 2.7 or 3.4+
  • The SendGrid service, starting at the free level

Install Package

pip install smtpapi

Setup Environment Variables

Update the development environment with your SENDGRID_API_KEY, for example:

cp .env_sample .env

In .env set SENDGRID_API_KEY to your own API key.

You can add your environment variables to your environment by sourcing the file:

source .env

Quick Start

from smtpapi import SMTPAPIHeader

header = SMTPAPIHeader()

How to Contribute

We encourage contribution to our projects, please see our CONTRIBUTING guide for more details.

Quick links:

Local Setup of the Project

The simplest local development workflow is by using Docker.


  1. Install [Docker](
  2. Run docker-compose build (this builds the container)
  3. Run docker-compose up (this runs tests by default)


smtpapi-python is maintained and funded by Twilio SendGrid, Inc. The names and logos for smtpapi-python are trademarks of Twilio SendGrid, Inc.

Project details

Download files

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

Files for smtpapi, version 0.4.7
Filename, size File type Python version Upload date Hashes
Filename, size smtpapi-0.4.7-py3-none-any.whl (4.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size smtpapi-0.4.7.tar.gz (4.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page