Skip to main content

Email sending for Flask

Project description

Flask Red Mail: Email Sending for Flask

Flask extension for Red Mail


Pypi version build codecov Documentation Status PyPI pyversions

What is it?

Flask Red Mail is a Flask extension for 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:

Installation

Install the extension from PyPI:

pip install flask-redmail

Example

Create a simple Flask application:

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"] = "me@example.com"
app.config["EMAIL_PASSWORD"] = "<PASSWORD>"
app.config["EMAIL_SENDER"] = "no-reply@example.com"

Use the extension:

@app.route("/send")
def send_email():
    email.send(
        subject="An example",
        receivers=["you@example.com"],
        html="<h1>An example email.</h1>"
    )

Author

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Flask-Redmail-0.3.0.tar.gz (23.5 kB view hashes)

Uploaded Source

Built Distribution

Flask_Redmail-0.3.0-py3-none-any.whl (7.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page