Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pallets-eco/flask-mail
Flask-Mail adds SMTP mail sending to your Flask applications
https://github.com/pallets-eco/flask-mail
email flask flask-mail pallets pallets-eco python smtp
Last synced: 4 days ago
JSON representation
Flask-Mail adds SMTP mail sending to your Flask applications
- Host: GitHub
- URL: https://github.com/pallets-eco/flask-mail
- Owner: pallets-eco
- License: bsd-3-clause
- Created: 2012-02-29T16:39:29.000Z (almost 13 years ago)
- Default Branch: main
- Last Pushed: 2024-09-01T15:59:36.000Z (4 months ago)
- Last Synced: 2024-10-29T15:12:32.014Z (about 2 months ago)
- Topics: email, flask, flask-mail, pallets, pallets-eco, python, smtp
- Language: Python
- Homepage: https://flask-mail.readthedocs.io
- Size: 359 KB
- Stars: 607
- Watchers: 29
- Forks: 172
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE.txt
Awesome Lists containing this project
- best-of-web-python - GitHub - 8% open · ⏱️ 23.05.2024): (Email)
README
# Flask-Mail
Flask-Mail is an extension for [Flask] that makes it easy to send emails from
your application. It simplifies the process of integrating email functionality,
allowing you to focus on building great features for your application.[flask]: https://flask.palletsprojects.com
## Pallets Community Ecosystem
> [!IMPORTANT]\
> This project is part of the Pallets Community Ecosystem. Pallets is the open
> source organization that maintains Flask; Pallets-Eco enables community
> maintenance of related projects. If you are interested in helping maintain
> this project, please reach out on [the Pallets Discord server][discord].[discord]: https://discord.gg/pallets
## A Simple Example
```python
from flask import Flask
from flask_mail import Mail, Messageapp = Flask(__name__)
app.config['MAIL_SERVER'] = 'your_mail_server'
app.config['MAIL_PORT'] = 587
app.config['MAIL_USE_TLS'] = True
app.config['MAIL_USE_SSL'] = False
app.config['MAIL_USERNAME'] = 'your_username'
app.config['MAIL_PASSWORD'] = 'your_password'
app.config['MAIL_DEFAULT_SENDER'] = '[email protected]'mail = Mail(app)
@app.route('/')
def send_email():
msg = Message(
'Hello',
recipients=['[email protected]'],
body='This is a test email sent from Flask-Mail!'
)
mail.send(msg)
return 'Email sent succesfully!'
```