def email(self):
try:
to_email = request.args.get('to_email')
path, attr = configuration.get('email', 'EMAIL_BACKEND').rsplit('.', 1)
logging.info("path: " + str(path))
logging.info("attr: " + str(attr))
module = importlib.import_module(path)
logging.info("module: " + str(module))
backend = getattr(module, attr)
backend(to_email, "Test Email", "Test Email", files=None, dryrun=False)
flash('Email Sent')
except Exception as e:
flash('Failed to Send Email: ' + str(e), 'error')
return redirect("/admin/admintools", code=302)
admin_tools_plugin.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录