smtpapi
Simple wrapper to use SendGrid SMTP API
What it is and what it does
smtpapi is a lightweight Python wrapper that constructs SendGrid SMTP API headers for insertion into standard SMTP messages. It provides a simple object interface to build headers that tell SendGrid's SMTP servers how to handle your email—adding recipients, scheduling delivery, applying templates, and other SendGrid-specific features—without requiring a separate HTTP API call.
The package has no external runtime dependencies and works by serializing your configuration into JSON headers that SMTP clients can attach to outgoing mail. You instantiate an SMTPAPIHeader object, call methods like add_to() to configure recipients or other directives, then export the result as a JSON string to include in your SMTP transmission. It's designed for developers who prefer SMTP over HTTP for email delivery but want to leverage SendGrid's advanced features.
Use it for:
- Adding multiple recipients or CC/BCC addresses to an SMTP message without modifying the envelope.
- Scheduling email delivery for a future time through SendGrid's SMTP API.
- Applying SendGrid templates or categories to emails sent via SMTP instead of the HTTP API.
- Building custom SMTP clients that need SendGrid-specific headers without pulling in a full SDK.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Builds SendGrid SMTP API headers for use in SMTP email transmission, allowing you to add SendGrid-specific directives like recipient lists and scheduling to standard SMTP messages.
Yes, if you are already using SendGrid's SMTP endpoint and need to attach SendGrid-specific directives to your messages. The zero-dependency design and permissive MIT license make it a low-risk addition. However, verify that your use case aligns with SendGrid's current SMTP API feature set, as the last release was in 2022 and you should confirm the package still covers your needs.
Install
smtpapi on PyPI
pip
pip install smtpapiuv
uv add smtpapipoetry
poetry add smtpapiInstalling smtpapi
Before you install
Low friction install with no runtime dependencies. Last release was in 2022, but the repository remains active with recent commits as of 2026-06-25.
License in practice
MIT License permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install smtpapi
from smtpapi import SMTPAPIHeader
header = SMTPAPIHeader()
header.add_to('email@email.com')
print(header.json_string())
Verify before relying
- Whether the package is actively maintained for modern SendGrid API changes or if it has been superseded by a newer official library.
- Current compatibility with SendGrid's SMTP API feature set and whether all documented features are still supported.
Package facts
| License | MIT License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,619 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 140,509/month — #11,271 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: smtpapi-0.4.12-py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
python-http-clientProvides a simplified Python interface for…
permissive · top 1,000 on PyPI
sendgridSends emails and SMS messages via the Twilio…
permissive · top 1,000 on PyPI
django-sendgrid-v5Provides a Django email backend that sends…
permissive · top 15,000 on PyPI
apache-airflow-providers-sendgridIntegrates SendGrid email delivery into Apache…
permissive · top 15,000 on PyPI
emailsBuild and send HTML and plain-text emails with…
permissive · top 15,000 on PyPI
sparkpostOfficial Python client for the SparkPost email…
permissive · top 15,000 on PyPI
apache-airflow-providers-smtpAdds SMTP email sending capabilities to Apache…
permissive · top 5,000 on PyPI
prefect-emailProvides Prefect workflow integration for…
permissive · top 15,000 on PyPI
yagmailSimplifies sending emails via Gmail or any SMTP…
permissive · top 15,000 on PyPI
Flask-MailFlask-Mail adds email-sending functionality to…
permissive · top 5,000 on PyPI