Flask-Mailing is a highly efficient and user-friendly package that enables Asynchronous
email messaging in Flask applications. Asynchronous email messaging is becoming increasingly popular because it allows applications to continue running while emails are being sent in the background. This makes it an ideal solution for time-sensitive applications that require a fast and responsive user experience.
With Flask-Mailing, developers can easily integrate asynchronous email messaging capabilities into their Flask applications without the need for complex configurations or additional dependencies. The package offers a variety of features, including support for multiple email providers, email templates, and error handling. It also supports common email protocols, such as SMTP
, SSL
, and TLS
.
Moreover, Flask-Mailing offers a simple and intuitive API that allows developers to easily send emails in the background. It also provides advanced features, such as email tracking and reporting, which enable developers to monitor email performance and user engagement.
Whether you're building a small-scale application or a large-scale enterprise system, Flask-Mailing provides a reliable and scalable solution for Asynchronous email messaging in Flask applications.
-
๐ Supports asynchronous email sending using the built-in
asyncio
library in Python 3.5+. -
๐ Easily integrates with Flask applications using the provided
Mail
extension. -
โ๏ธ Offers simple and intuitive configuration options for email providers such as SMTP, Sendgrid, and Mailgun.
-
โ๏ธ Supports HTML and plain-text message formats, as well as the option to send both formats in a multi-part message.
-
๐ Provides support for file attachments in emails.
-
๐จ Includes customizable email templates and support for Jinja2 templates.
-
๐ Offers a simple API for sending email messages, allowing for quick and easy implementation in any Flask project.
-
๐ง Supports bulk email sending, allowing for the efficient delivery of messages to large email lists.
-
๐ Provides options for customizing email headers and message priority levels.
-
๐ Supports email tracking through message IDs and delivery status notifications.
-
๐ฌ Includes a comprehensive testing suite for ensuring the correct configuration and behavior of the email sending functionality.
-
๐ Supports email encryption and authentication using TLS and SSL protocols.
-
โ ๏ธ Offers error handling and logging functionality for tracking and resolving email sending issues. -
๐ Provides detailed documentation and active community support for resolving any issues or questions related to the package.
More information on Getting-Started
๐ Package health score by snyk.io
โค๏ธ Github
๐ Documentation
๐ PYPI
pip install flask-mailing
or install from the source code
git clone https://github.com/marktennyson/flask-mailing.git && cd flask-mailing
python -m pip install .
from flask import Flask, jsonify
from flask_mailing import Mail, Message
app = Flask(__name__)
app.config['MAIL_USERNAME'] = "YourUserName"
app.config['MAIL_PASSWORD'] = "strong_password"
app.config['MAIL_PORT'] = 587
app.config['MAIL_SERVER'] = "your mail server"
app.config['MAIL_USE_TLS'] = True
app.config['MAIL_USE_SSL'] = False
app.config['USE_CREDENTIALS'] = True
app.config['VALIDATE_CERTS'] = True
app.config['MAIL_DEFAULT_SENDER'] = "[email protected]"
mail = Mail(app)
html = """
<p>Thanks for using Flask-Mailing</p>
"""
@app.post("/email")
async def simple_send():
message = Message(
subject="Flask-Mailing module",
recipients=["[email protected]"], # List of recipients, as many as you can pass
body=html,
subtype="html"
)
await mail.send_message(message)
return jsonify(status_code=200, content={"message": "email has been sent"})
For more examples of using flask-mailing please check example section
Feel free to open issues and send pull requests.
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