Example #1
0
def async_send_mail(app, msg):
    with app.app_context():
        mail.send(message=msg)
Example #2
0
def async_send_mail(app, msg):
    """
    获取文件上下文
    """
    with app.app_context():
        mail.send(message=msg)
Example #3
0
def send_message_async(app, msg):
    with app.app_context():  #管理程序上下文
        mail.send(message=msg)
Example #4
0
def async_send_mail(app, msg):
    # 使用新的线程发送邮件
    # 使用完了需要关闭
    with app.app_context():
        mail.send(msg)