当通过Flask Mail发送任何消息时,比如下面,带有mail.send(msg)
的最后一行也会导致记录邮件头和内容。你知道吗
Message("Hello", sender="from@example.com", recipients=["to@example.com"])
msg.body = 'anything'
mail.send(msg)
由于我的邮件可能包含敏感信息,我想完全禁用此日志记录。但是,在使用日志模块时,我找不到为Flask Mail配置的记录器。你知道吗
如何禁用登录邮件?你知道吗
Tags:
我想出来了:
Flask Mail使用Python的smtplib发送邮件。smtplib不使用日志模块,但它将调试信息打印到stderr。你知道吗
smtplib包括以下方法:
如果我们使用Flask Mail,我们可以在初始化应用程序时设置此变量,如下所示:
任何输出现在都被抑制。你知道吗
相关问题 更多 >
编程相关推荐