def _connect_smtp(self, force=False):
if self.smtp_connection is not None and not force:
return True
try:
logging.debug("Connecting to SMTP server {}:{}".format(
self.host, self.port))
smtp = smtplib.SMTP(self.host, self.port)
if self.username and self.password:
smtp.login(self.username, self.password)
self.smtp_connection = smtp
except Exception as e:
logging.error("Error while connecting to SMTP server: "
"{}".format(str(e)),
exc_info=True)
return False
return True
invalidroutesreporter.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录