yagmail
Yet Another GMAIL client
Decision gist · record as of 2026-08-14
Yes. Yagmail is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It is well-suited for developers who need straightforward email sending without the complexity of raw SMTP or heavier frameworks. Use it when you want to send emails quickly from Python without boilerplate—particularly for Gmail or simple SMTP scenarios. The built-in async support and intelligent content handling make it practical for both scripts and applications.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Gmail requires an Application-Specific Password (regular account passwords no longer work over SMTP); alternatively, OAuth2 authentication can be used.
- Low install friction with a single runtime dependency (premailer).
- Active maintenance with a recent release (80 days ago) and 2731 repository stars indicate ongoing support and community use.
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
last release 2026-05-26 (80 days) · last repo commit 2026-05-26 · 2,731 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 382,123 downloads/mo, #7,092 on PyPI
Alternatives
Verify before relying
pip install yagmail
import yagmail
yag = yagmail.Client('mygmailusername', 'mygmailpassword')
yag.send('to@someone.com', 'subject', 'body text')- Whether premailer dependency is required for all use cases or only for HTML email rendering.
- Current state of OAuth2 token refresh behavior and whether the 7-day expiry limitation still applies.
- Performance characteristics when sending bulk emails or handling large attachments.
What it is and what it does
Yagmail is a Python SMTP client designed to make sending emails as straightforward as possible. It wraps the standard library's SMTP functionality and adds convenience features like automatic content-type detection (plain text, HTML, images, attachments), support for multiple recipients with aliases, and both synchronous and asynchronous sending via asyncio. The package handles the common friction points of email composition—figuring out MIME types, encoding attachments, building multipart messages—so you can focus on the message content.
It works with Gmail (using Application-Specific Passwords or OAuth2) and any SMTP server. The API is minimal: instantiate a Client with credentials, then call send() with recipients, subject, and contents. Contents can be a mix of strings, file paths, and HTML snippets, and the library intelligently detects what each item is. An asynchronous version is built in for non-blocking email operations.
Use it for
- Sending transactional emails (notifications, confirmations) from a Python application without managing SMTP boilerplate.
- Automating bulk email campaigns with attachments and HTML formatting from a script or scheduled task.
- Building a command-line email tool that accepts recipients, subject, and file attachments as arguments.
- Integrating email alerts into monitoring or logging systems with minimal code overhead.
- Sending emails asynchronously in a web application to avoid blocking request handlers.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Yagmail is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It is well-suited for developers who need straightforward email sending without the complexity of raw SMTP or heavier frameworks. Use it when you want to send emails quickly from Python without boilerplate—particularly for Gmail or simple SMTP scenarios. The built-in async support and intelligent content handling make it practical for both scripts and applications.
Install
yagmail on PyPI
Before you install
Low install friction with a single runtime dependency (premailer). Active maintenance with a recent release (80 days ago) and 2731 repository stars indicate ongoing support and community use.
Gmail requires an Application-Specific Password (regular account passwords no longer work over SMTP); alternatively, OAuth2 authentication can be used.
License in practice
MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install yagmail
import yagmail
yag = yagmail.Client('mygmailusername', 'mygmailpassword')
yag.send('to@someone.com', 'subject', 'body text')
Verify before relying
- Whether premailer dependency is required for all use cases or only for HTML email rendering.
- Current state of OAuth2 token refresh behavior and whether the 7-day expiry limitation still applies.
- Performance characteristics when sending bulk emails or handling large attachments.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagepremailer |
| Maintenance | Actively maintained 80 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 382,123 / month, #7,092 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Environment :: ConsoleIntended Audience :: Customer ServiceIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: MicrosoftOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Communications :: EmailTopic :: Communications :: Email :: Email Clients (MUA)Topic :: Software DevelopmentTopic :: Software Development :: Build ToolsTopic :: Software Development :: DebuggersTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Software DistributionTopic :: System :: Systems AdministrationTopic :: Utilities |
Evidence: yagmail-0.16.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “gmail api alternative”
- yagmailSimplifies sending emails via Gmail or any SMTP server, with built-in…
- simplegmailA Python wrapper around the Gmail API that handles authentication,…
- aiogoogleAiogoogle is an async Python client for accessing Google's public…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also emails · fastapi-mail · simplegmail · django-post_office · redmail · azure-communication-email · aiosmtplib · sparkpost · resend · aiosmtpd