Modern Flask mail system for 2026+ with async support, bulk operations, and full Flask 3.1+ compatibility
Project description
โ๏ธ Flask-Mailing v3.0.0 ๐
๐ The Future of Flask Email - Available Today!
Flask-Mailing v3.0.0 represents the pinnacle of modern Python email handling. Built for 2026 and beyond, it combines cutting-edge Python 3.10+ features, Flask 3.1+ compatibility, and enterprise-grade security into one powerful package.
โจ What's Revolutionary in v3.0.0
๐ฏ Modern Python Excellence
- โ
Python 3.10+ Required - Modern union syntax (
str | None) and built-in generics - โ Python 3.14 Ready - Future-proof architecture
- โ Type Safety First - Full type hints with mypy validation
- โ Performance Optimized - Built for modern Python performance gains
๐ก๏ธ Enterprise Security
- ๐ Rate Limiting - Prevent abuse with built-in rate limiting
- ๐ก๏ธ Email Security Validation - Detect and block disposable/malicious emails
- ๐ Path Traversal Protection - Enhanced file attachment security
- ๐จ Content Sanitization - Prevent injection attacks
- ๐ Security Scanning - Automated vulnerability detection
โก Next-Gen Architecture
- ๐ Modern Async Patterns - Proper context managers and error handling
- ๐ฆ Pydantic v2.11+ - Latest validation with enhanced performance
- ๐๏ธ Modern Build System - Ruff, Black, isort, mypy integration
- ๐ณ Container Ready - Docker support with security best practices
๐ Requirements
- Python 3.10+ (3.14 compatible!)
- Flask 3.1+ with async support
- Modern development environment
๐ง Installation
# 2026-Ready Installation (Python 3.10+ required)
pip install flask-mailing>=3.0.0
# With enhanced security features
pip install flask-mailing[email-checking]
# Full development setup
pip install flask-mailing[dev,email-checking]
๐ฆ Development Installation
git clone https://github.com/marktennyson/flask-mailing.git
cd flask-mailing
pip install -e ".[dev,email-checking]"
๐ Modern Quick Start
Flask 3.1+ with Modern Python Features
from flask import Flask, jsonify
from flask_mailing import Mail, Message
app = Flask(__name__)
# Configuration for Flask 3.x
app.config.update(
MAIL_USERNAME="your.email@gmail.com",
MAIL_PASSWORD="your_app_password",
MAIL_PORT=587,
MAIL_SERVER="smtp.gmail.com",
MAIL_USE_TLS=True,
MAIL_USE_SSL=False,
USE_CREDENTIALS=True,
VALIDATE_CERTS=True,
MAIL_DEFAULT_SENDER="your.email@gmail.com",
MAIL_FROM_NAME="Your App Name"
)
mail = Mail(app)
@app.post("/send-email")
async def send_email():
message = Message(
subject="Flask-Mailing v3.0.0 Test",
recipients=["recipient@example.com"],
body="Hello from Flask-Mailing v3.0.0! ๐\n\nNow with Python 3.10-3.14 and Flask 3.x support!",
subtype="plain"
)
await mail.send_message(message)
return jsonify({"status": "Email sent successfully!"})
if __name__ == "__main__":
app.run(debug=True)
HTML Email with Modern Syntax
@app.post("/send-html")
async def send_html():
html_content = """
<html>
<body style="font-family: Arial, sans-serif;">
<h1 style="color: #2c3e50;">Welcome to Flask-Mailing v3.0.0!</h1>
<p>This email was sent using the modernized Flask-Mailing library.</p>
<ul>
<li>โ
Python 3.10-3.14 compatible</li>
<li>โ
Flask 3.1+ ready</li>
<li>โ
Enhanced performance</li>
</ul>
</body>
</html>
"""
message = Message(
subject="๐ Flask-Mailing v3.0.0 - HTML Email",
recipients=["recipient@example.com"],
html=html_content,
subtype="html"
)
await mail.send_message(message)
return jsonify({"status": "HTML email sent!"})
Bulk Email Support
@app.post("/send-bulk")
async def send_bulk():
email_data = (
("Subject 1", "Message 1", ["user1@example.com"]),
("Subject 2", "Message 2", ["user2@example.com"]),
("Subject 3", "Message 3", ["user3@example.com"]),
)
await mail.send_mass_mail(email_data)
return jsonify({"status": "Bulk emails sent successfully!"})
๐ Documentation
For detailed documentation, examples, and API reference:
- ๐ Documentation
- ๐ง Configuration Guide
- ๐ Examples
๐ Migration from v0.2.x
Breaking Changes in v3.0.0
- Minimum Python version: 3.10+ (was 3.6+)
- Minimum Flask version: 3.1+ (was 2.0+)
- Pydantic v2: Updated from v1.x to v2.11+
- Email checking utilities: Now optional dependencies
Migration Steps
- Upgrade Python to 3.10+ (recommended: 3.12+)
- Upgrade Flask to 3.1+
- Update requirements.txt:
# Old flask-mailing>=0.2.3 # New flask-mailing>=3.0.0
- Test your application - most APIs remain the same
๐ Version Compatibility
| Flask-Mailing | Python | Flask | Pydantic | Status |
|---|---|---|---|---|
| 3.0.0+ | 3.10-3.14 | 3.1+ | 2.11+ | โ Active |
| 0.2.x | 3.6+ | 2.0+ | 1.8+ | ๐ Legacy |
๐งช Testing
# Run tests with Python 3.13
python -m pytest tests/ -v
# Run with multiple Python versions using tox
tox
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
๐ Dependencies
Core Dependencies
aiosmtplib>=4.0.1- Async SMTP clientflask>=3.1.0- Web frameworkpydantic>=2.11.0- Data validationpydantic-settings>=2.9.0- Settings managementemail-validator>=2.3.0- Email validationjinja2>=3.1.6- Template engine
Optional Dependencies
redis>=5.3.0- For email checking featureshttpx>=0.28.1- For HTTP-based email validationdnspython>=2.8.0- For DNS-based validation
๐ License
๐ Stats
๐ Links
- ๐ Github
- ๐ Documentation
- ๐ PyPI
- ๐ Issues
- ๐ฌ Discussions
Made with โค๏ธ for the Python & Flask community
Flask-Mailing v3.0.0 - Ready for the future of Python development!
Star History
Key Features :sparkles:
-
:arrows_counterclockwise: Supports asynchronous email sending using the built-in
asynciolibrary in Python 3.10+. -
:link: Easily integrates with Flask applications using the provided
Mailextension. -
:gear: Offers simple and intuitive configuration options for email providers such as SMTP, Sendgrid, and Mailgun.
-
:envelope: Supports HTML and plain-text message formats, as well as the option to send both formats in a multi-part message.
-
:paperclip: Provides support for file attachments in emails.
-
:art: Includes customizable email templates and support for Jinja2 templates.
-
:rocket: Offers a simple API for sending email messages, allowing for quick and easy implementation in any Flask project.
-
:email: Supports bulk email sending, allowing for the efficient delivery of messages to large email lists.
-
:bookmark_tabs: Provides options for customizing email headers and message priority levels.
-
:chart_with_upwards_trend: Supports email tracking through message IDs and delivery status notifications.
-
:microscope: Includes a comprehensive testing suite for ensuring the correct configuration and behavior of the email sending functionality.
-
:lock: Supports email encryption and authentication using TLS and SSL protocols.
-
:warning: Offers error handling and logging functionality for tracking and resolving email sending issues.
-
:book: Provides detailed documentation and active community support for resolving any issues or questions related to the package.
More information on Getting-Started
๐ฅ Downloads
๐ Package health score by snyk.io
๐ Important Links
โค๏ธ Github
๐ Documentation
๐ PYPI
๐ Contributors โจ
Thanks go to these wonderful people ([๐ง]):
Aniket Sarkar ๐ฌ ๐ ๐ง |
Joshua Kinslow |
Alexandre Gramfort |
ahmetkurukose |
Sriram |
CharlesTWood |
This project follows the all-contributors specification. Contributions of any kind are welcome!
Before you start please read CONTRIBUTING
๐ LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flask_mailing-3.0.0.tar.gz.
File metadata
- Download URL: flask_mailing-3.0.0.tar.gz
- Upload date:
- Size: 147.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa6b7a9efded4ce7d3c60afaa595c34771e330aa739673efd65940397f0864c6
|
|
| MD5 |
10d3dde80dc460dbcb53c7b193ecf042
|
|
| BLAKE2b-256 |
2d162f19b6fca9615a8fef34c7ff42f29948bd92b87e0798bac809ce6543ff3d
|
Provenance
The following attestation bundles were made for flask_mailing-3.0.0.tar.gz:
Publisher:
ci.yml on marktennyson/flask-mailing
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flask_mailing-3.0.0.tar.gz -
Subject digest:
fa6b7a9efded4ce7d3c60afaa595c34771e330aa739673efd65940397f0864c6 - Sigstore transparency entry: 731679716
- Sigstore integration time:
-
Permalink:
marktennyson/flask-mailing@752092e2a5fd76cfb00bfeaa218a4c687067e648 -
Branch / Tag:
refs/tags/3.0.0 - Owner: https://github.com/marktennyson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@752092e2a5fd76cfb00bfeaa218a4c687067e648 -
Trigger Event:
release
-
Statement type:
File details
Details for the file flask_mailing-3.0.0-py3-none-any.whl.
File metadata
- Download URL: flask_mailing-3.0.0-py3-none-any.whl
- Upload date:
- Size: 31.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68a19eec57522c9d6127ddc2acdf831e5fb004a98a48b8bb855b556929d1fd0b
|
|
| MD5 |
a29467e305ac49b0d6c11095ad14a5ce
|
|
| BLAKE2b-256 |
be81d8ee1a6f5caf04897abd48ece115a72246637b10333501e5a9938c3afb85
|
Provenance
The following attestation bundles were made for flask_mailing-3.0.0-py3-none-any.whl:
Publisher:
ci.yml on marktennyson/flask-mailing
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flask_mailing-3.0.0-py3-none-any.whl -
Subject digest:
68a19eec57522c9d6127ddc2acdf831e5fb004a98a48b8bb855b556929d1fd0b - Sigstore transparency entry: 731679718
- Sigstore integration time:
-
Permalink:
marktennyson/flask-mailing@752092e2a5fd76cfb00bfeaa218a4c687067e648 -
Branch / Tag:
refs/tags/3.0.0 - Owner: https://github.com/marktennyson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@752092e2a5fd76cfb00bfeaa218a4c687067e648 -
Trigger Event:
release
-
Statement type: