METADATA 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. Metadata-Version: 2.1
  2. Name: Flask-Mail
  3. Version: 0.10.0
  4. Summary: Flask extension for sending email
  5. Author: Dan Jacob
  6. Maintainer-email: Pallets Ecosystem <contact@palletsprojects.com>
  7. Requires-Python: >=3.8
  8. Description-Content-Type: text/markdown
  9. Classifier: Development Status :: 4 - Beta
  10. Classifier: Framework :: Flask
  11. Classifier: License :: OSI Approved :: BSD License
  12. Classifier: Programming Language :: Python
  13. Classifier: Typing :: Typed
  14. Requires-Dist: flask
  15. Requires-Dist: blinker
  16. Project-URL: Changes, https://flask-mail.readthedocs.io/en/latest/changes/
  17. Project-URL: Chat, https://discord.gg/pallets
  18. Project-URL: Documentation, https://flask-mail.readthedocs.io
  19. Project-URL: Source, https://github.com/pallets-eco/flask-mail/
  20. # Flask-Mail
  21. Flask-Mail is an extension for [Flask] that makes it easy to send emails from
  22. your application. It simplifies the process of integrating email functionality,
  23. allowing you to focus on building great features for your application.
  24. [flask]: https://flask.palletsprojects.com
  25. ## Pallets Community Ecosystem
  26. > [!IMPORTANT]\
  27. > This project is part of the Pallets Community Ecosystem. Pallets is the open
  28. > source organization that maintains Flask; Pallets-Eco enables community
  29. > maintenance of related projects. If you are interested in helping maintain
  30. > this project, please reach out on [the Pallets Discord server][discord].
  31. [discord]: https://discord.gg/pallets
  32. ## A Simple Example
  33. ```python
  34. from flask import Flask
  35. from flask_mail import Mail, Message
  36. app = Flask(__name__)
  37. app.config['MAIL_SERVER'] = 'your_mail_server'
  38. app.config['MAIL_PORT'] = 587
  39. app.config['MAIL_USE_TLS'] = True
  40. app.config['MAIL_USE_SSL'] = False
  41. app.config['MAIL_USERNAME'] = 'your_username'
  42. app.config['MAIL_PASSWORD'] = 'your_password'
  43. app.config['MAIL_DEFAULT_SENDER'] = 'your_email@example.com'
  44. mail = Mail(app)
  45. @app.route('/')
  46. def send_email():
  47. msg = Message(
  48. 'Hello',
  49. recipients=['recipient@example.com'],
  50. body='This is a test email sent from Flask-Mail!'
  51. )
  52. mail.send(msg)
  53. return 'Email sent succesfully!'
  54. ```