Flask Async Mail
flask-async-mail is a Flask extension that simplifies sending emails asynchronously using Celery. This library is designed to help you handle email sending as a background task, improving the performance and responsiveness of your Flask applications.
Installation
pip install flask-async-mail
Usage
First, initialize the extension in your Flask application:
from flask import Flask
from flask_async_mail import FlaskCelery
app = Flask(__name__)
celery = FlaskCelery()
celery.init_app(app)
Then, configure your email settings:
app.config.update(
CELERY_BROKER_URL = "redis://localhost:6379/0"
CELERY_RESULT_BACKEND = "redis://localhost:6379/0"
SMTP_HOST='smtp.example.com',
PORT=587,
USE_TLS=True,
USE_SSL=False,
SENDER='your-email@example.com',
PASSWORD='your-password'
)
using celery as decorator
from flask_async_mail.email_service import SendMail
mailer = SendMail(app.config.items())
@celery.task
async def send_client_mail():
await mailer.send_email(
subject="Hello, I'am FlaskCelery",
recipient=["flaskcelery@example.com"],
content="""
<html>
<body>
<h1>Hello user, This is FlaskCelery Library Update</h1>
</body>
</html>
""",
content_type="html"
)
run command
celery -A task.celery worker --loglevel=info
Metadata
Release files for flask-async-mail 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flask_async_mail-0.1.0.tar.gz | 4.5 kB | Without provenance | Details for flask_async_mail-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flask_async_mail-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for flask_async_mail-0.1.0-py3-none-any.whl |
Total release size: 10.9 kB
Release files / flask_async_mail-0.1.0.tar.gz
| Download URL | flask_async_mail-0.1.0.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41ec8ee438edb0bef77c3f432030c920f5689a621af8ba67431cd592f354e157
|
|
BLAKE2b-256 checksum How to use checksums |
14c16561aacbb2a503f3ab9c91f5154832b9628c03ec542c963323c5ea38e084
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.13.1 Windows/10
|
Release files / flask_async_mail-0.1.0-py3-none-any.whl
| Download URL | flask_async_mail-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
75856e79fc67ec9c2efef4f263fe8d609fbe5d5e15b5765b740c26adbd712ae4
|
|
BLAKE2b-256 checksum How to use checksums |
857af6b4ec10078018cb01ce2b671ab84ee0d7102851984c12eeabd92f98bb3b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.13.1 Windows/10
|
Security for flask-async-mail 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.