get_imap_email.py 文件源码

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

项目:IMAPmailbox 作者: IMAPMailbox 项目源码 文件源码
def printBody( self, message, body, cstr ):
        if message.has_key('Content-Transfer-Encoding') and message.get('Content-Transfer-Encoding')=='base64':    
            try:
                body = base64.b64decode(body)
                #cstr.write('decoded base64 successfully' + '\n')
            except:
                cstr.write('WARNING - could not decode base64' + '\n')
                #pj suggested improvement by vragosta to get rid of occasional " =20" at end of lines.
        #cstr.write(body + '\n')
                cstr.write(quopri.decodestring(body) + '\n')

    # -------------------------------------------------
        # Get and print to STDOUT the mail message
        # -------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号