Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/miksus/flask-redmail

Email sending for Flask
https://github.com/miksus/flask-redmail

email flask redmail

Last synced: 2 months ago
JSON representation

Email sending for Flask

Awesome Lists containing this project

README

        

# Flask Red Mail: Email Sending for Flask
> Flask extension for Red Mail

---

[![Pypi version](https://badgen.net/pypi/v/flask_redmail)](https://pypi.org/project/flask_redmail/)
[![build](https://github.com/Miksus/flask-redmail/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/Miksus/flask-redmail/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/Miksus/flask-redmail/branch/master/graph/badge.svg?token=IMR1CQT9PY)](https://codecov.io/gh/Miksus/flask-redmail)
[![Documentation Status](https://readthedocs.org/projects/flask-redmail/badge/?version=latest)](https://red-mail.readthedocs.io/en/latest/)
[![PyPI pyversions](https://badgen.net/pypi/python/flask-redmail)](https://pypi.org/project/flask-redmail/)

## What is it?
Flask Red Mail is a Flask extension for [Red Mail](https://github.com/Miksus/red-mail).
Red Mail is a powerful email sender library capable of including
attachments from various formats, embedding images, parametrization
with Jinja etc. This library harness the power of Red Mail in order to
make it trivial to:

- Send verification emails to users
- Create email based *forgot password* functionality
- Create Flask based email news letters
- Handle other needs for sending emails from a web application

Links:

- [Flask-Redmail's source code](https://github.com/Miksus/flask-redmail)
- [Flask-Redmail's documentation](https://flask-redmail.readthedocs.io/)
- [Flask-Redmail's releases (PyPI)](https://pypi.org/project/Flask-Redmail/)
- [Red Mail's source code](https://github.com/Miksus/red-mail)
- [Red Mail's documentation](https://red-mail.readthedocs.io/)
- [Red Mail's releases (PyPI)](https://pypi.org/project/redmail/)

## Installation

Install the extension from PyPI:

```console
pip install flask-redmail
```

## Example

Create a simple Flask application:

```python
import flask
from flask_redmail import RedMail

app = flask.Flask(__name__)
email = RedMail(app)

# Configure
app.config["EMAIL_HOST"] = "localhost"
app.config["EMAIL_PORT"] = 0

# Optional
app.config["EMAIL_USERNAME"] = "[email protected]"
app.config["EMAIL_PASSWORD"] = ""
app.config["EMAIL_SENDER"] = "[email protected]"
```

Use the extension:

```python
@app.route("/send")
def send_email():
email.send(
subject="An example",
receivers=["[email protected]"],
html="

An example email.

"
)
```

---

## Author

* **Mikael Koli** - [Miksus](https://github.com/Miksus) - [email protected]