ELEC60013-ES-CW1/lib/mail.py
2022-02-06 14:18:22 +00:00

8 lines
245 B
Python

from flask import current_app
from flask_mail import Mail, Message
def send(subject, sender, recipients, body):
mail = Mail(current_app)
msg = Message(subject, sender=sender, recipients=recipients)
msg.body = body
mail.send(msg)