check_for_articles_from_email.py 文件源码

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

项目:prestashop-sync 作者: dragoon 项目源码 文件源码
def connect(self):
        """Connects to and authenticates with an IMAP4 mail server"""

        import imaplib

        M = None
        try:
            if (self.keyfile and self.certfile) or self.ssl:
                M = imaplib.IMAP4_SSL(self.host, self.port, self.keyfile, self.certfile)
            else:
                M = imaplib.IMAP4(self.host, self.port)

            M.login(self.username, self.password)
            M.select()
        except socket.error, err:
            raise
        else:
            return M
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号