def send_async(app, message): ''' Send the mail asynchronously. ''' with app.app_context(): mail.send(message)