flask_mail.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:pyetje 作者: rorlika 项目源码 文件源码
def init_app(self, app):
        """Initializes your mail settings from the application settings.

        You can use this if you want to set up your Mail instance
        at configuration time.

        :param app: Flask application instance
        """

        state = _Mail(
            app.config.get('MAIL_SERVER', '127.0.0.1'),
            app.config.get('MAIL_USERNAME'),
            app.config.get('MAIL_PASSWORD'),
            app.config.get('MAIL_PORT', 25),
            app.config.get('MAIL_USE_TLS', False),
            app.config.get('MAIL_USE_SSL', False),
            app.config.get('MAIL_DEFAULT_SENDER'),
            int(app.config.get('MAIL_DEBUG', app.debug)),
            app.config.get('MAIL_MAX_EMAILS'),
            app.config.get('MAIL_SUPPRESS_SEND', app.testing))

        # register extension with app
        app.extensions = getattr(app, 'extensions', {})
        app.extensions['mail'] = state
        return state
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号