Skip to main content

Flask mail system sending mails(individual, bulk) attachments(individual, bulk)

Project description

Flask-Mailing

Flask-Mailing adds SMTP mail sending to your Flask applications

Flask_Mail is dead now. To use the mail service with your project you can use eaither Flask-Mailing for legacy or Flask-Mailman for Django type implementation.

Flask-Mailing is a fork of Sabuhi's Fastapi-Mail package, providing similar functionality. 99% of the work was done by him, and the fork was made mainly provide the same features and the apis for the Flask Microframework.

Need help to create and deploy the test cases.(Urgent)

🔨 Installation

 pip install Flask-mailing

or install from source code

git clone https://github.com/marktennyson/Flask-mailing.git && cd Flask-mailing
python setup.py install

Documentation: Flask-MAILING

The key features are:

  • sending emails with either with Flask or using asyncio module
  • sending files either from form-data or files from server
  • Using Jinja2 HTML Templates
  • email utils (utility allows you to check temporary email addresses, you can block any email or domain)
  • email utils has two available classes DefaultChecker and WhoIsXmlApi
  • Unittests using Mail

More information on Getting-Started

Guide

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_TLS'] = True
app.config['MAIL_SSL'] = False
app.config['USE_CREDENTIALS'] = True
app.config['VALIDATE_CERTS'] = True

mail = Mail(app)

html = """
<p>Thanks for using Flask-Mailing</p> 
"""


@app.post("/email")
async def simple_send() -> JSONResponse:

    message = Message(
        subject="Flask-Mailing module",
        recipients=["recipients@email-domain.com"],  # 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"})     

List of Examples

For more examples of using Flask-mailing please check example section

Contributing

Feel free to open issues and send pull requests.

Contributors ✨

Thanks goes to these wonderful people ([🚧]):


Aniket Sarkar

💬 👀 🚧

This project follows the all-contributors specification. Contributions of any kind are welcome!

Before you start please read CONTRIBUTING

LICENSE

MIT

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-Mailing-0.0.1.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

Flask_Mailing-0.0.1-py3.8.egg (31.4 kB view details)

Uploaded Source

File details

Details for the file Flask-Mailing-0.0.1.tar.gz.

File metadata

  • Download URL: Flask-Mailing-0.0.1.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.25.1 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for Flask-Mailing-0.0.1.tar.gz
Algorithm Hash digest
SHA256 81f3ef5d5dd0af74d2bef8db38f0223f16fe39e9480e7122a60f3ec6a0ace4c2
MD5 9261519dc4f59d78628f2e128b1dec97
BLAKE2b-256 a3eb44f8c4b3c949d517926cce10b0c623f740e084bb8488ca93a5e142e48656

See more details on using hashes here.

File details

Details for the file Flask_Mailing-0.0.1-py3.8.egg.

File metadata

  • Download URL: Flask_Mailing-0.0.1-py3.8.egg
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.25.1 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for Flask_Mailing-0.0.1-py3.8.egg
Algorithm Hash digest
SHA256 297622f6643ee6806d97251ab8c687f83172ca0edbec87ff65ca9477ad9d5425
MD5 2b47b928dc8b66c60ff9e9d73743cabf
BLAKE2b-256 11de00e584687f5c9be3bee489be0788a8c80ef53d3c14f70bac428b9385f14d

See more details on using hashes here.

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