smtp.py 文件源码

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

项目:NarshaTech 作者: KimJangHyeon 项目源码 文件源码
def close(self):
        """Closes the connection to the email server."""
        if self.connection is None:
            return
        try:
            try:
                self.connection.quit()
            except (ssl.SSLError, smtplib.SMTPServerDisconnected):
                # This happens when calling quit() on a TLS connection
                # sometimes, or when the connection was already disconnected
                # by the server.
                self.connection.close()
            except smtplib.SMTPException:
                if self.fail_silently:
                    return
                raise
        finally:
            self.connection = None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号