Skip to content

marktennyson/flask-mailing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

141 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

βœ‰οΈ Flask-Mailing v3.0.0 πŸš€

Flask mail logo

Python 3.10+ Flask 3.1+ Pydantic v2.11+ Async Ready Security Enhanced

🌟 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:

πŸ”„ 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

  1. Upgrade Python to 3.10+ (recommended: 3.12+)
  2. Upgrade Flask to 3.1+
  3. Update requirements.txt:
    # Old
    flask-mailing>=0.2.3
    
    # New  
    flask-mailing>=3.0.0
  4. 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 client
  • flask>=3.1.0 - Web framework
  • pydantic>=2.11.0 - Data validation
  • pydantic-settings>=2.9.0 - Settings management
  • email-validator>=2.3.0 - Email validation
  • jinja2>=3.1.6 - Template engine

Optional Dependencies

  • redis>=5.3.0 - For email checking features
  • httpx>=0.28.1 - For HTTP-based email validation
  • dnspython>=2.8.0 - For DNS-based validation

πŸ“œ License

MIT License

πŸ“Š Stats

Downloads Monthly Downloads Weekly Downloads

πŸ”— Links


Made with ❀️ for the Python & Flask community

Flask-Mailing v3.0.0 - Ready for the future of Python development!

Star History

Star History Chart


Key Features ✨

  1. πŸ”„ Supports asynchronous email sending using the built-in asyncio library in Python 3.10+.

  2. πŸ”— Easily integrates with Flask applications using the provided Mail extension.

  3. βš™οΈ Offers simple and intuitive configuration options for email providers such as SMTP, Sendgrid, and Mailgun.

  4. βœ‰οΈ Supports HTML and plain-text message formats, as well as the option to send both formats in a multi-part message.

  5. πŸ“Ž Provides support for file attachments in emails.

  6. 🎨 Includes customizable email templates and support for Jinja2 templates.

  7. πŸš€ Offers a simple API for sending email messages, allowing for quick and easy implementation in any Flask project.

  8. πŸ“§ Supports bulk email sending, allowing for the efficient delivery of messages to large email lists.

  9. πŸ“‘ Provides options for customizing email headers and message priority levels.

  10. πŸ“ˆ Supports email tracking through message IDs and delivery status notifications.

  11. πŸ”¬ Includes a comprehensive testing suite for ensuring the correct configuration and behavior of the email sending functionality.

  12. πŸ”’ Supports email encryption and authentication using TLS and SSL protocols.

  13. ⚠️ Offers error handling and logging functionality for tracking and resolving email sending issues.

  14. πŸ“– Provides detailed documentation and active community support for resolving any issues or questions related to the package.

More information on Getting-Started

πŸ“₯ Downloads

Downloads Downloads Downloads

πŸš‘ Package health score by snyk.io

Flask-Mailing

πŸ”— 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

MIT

About

Flask-Mailing is the ultimate solution for sending emails asynchronously in Flask applications. With its extensive features such as support for multiple email providers, file attachments, customizable templates, and encryption, Flask-Mailing makes email communication effortless and efficient.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors