skillfed

smtpapi

Simple wrapper to use SendGrid SMTP API

smtpapi v0.4.12 140.5K downloads/30d#11,271 on PyPI31
Permissive license MIT License Active released

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 smtpapi

uv

uv add smtpapi

poetry

poetry add smtpapi

Installing 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

Programming Language :: Python :: 2.7Programming Language :: Python :: 3.10Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

sendgrid smtp api headerssmtp api header buildersendgrid email headerssmtp api python wrappersendgrid smtp integration
sendgridsmtpemail-headers

More Internet packages