Set*_*ori 2 python email fonts jython asianfonts
self.logger.info(msg)
popinstance=poplib.POP3(self.account[0])
self.logger.info(popinstance.getwelcome())
popinstance.user(self.account[1])
popinstance.pass_(self.account[2])
try:
(numMsgs, totalSize)=popinstance.stat()
self.logger.info("POP contains " + str(numMsgs) + " emails")
for thisNum in xrange(1, numMsgs + 1):
try:
(server_msg, body, octets)=popinstance.retr(thisNum)
except:
self.logger.error("Could not download email")
raise
text="\n".join(body)
mesg=StringIO.StringIO(text)
msg=rfc822.Message(mesg)
MessageID=email.Utils.parseaddr(msg["Message-ID"])[1]
self.logger.info("downloading email " + MessageID)
emailpath=os.path.join(self._emailpath + self._inboxfolder + "\\" + self._sanitize_string(MessageID + ".eml"))
emailpath=self._replace_whitespace(emailpath)
try:
self._dual_dump(text,emailpath)
except:
pass
self.logger.info(popinstance.dele(thisNum))
finally:
self.logger.info(popinstance.quit())
Run Code Online (Sandbox Code Playgroud)
(server_msg,body,octets)= popinstance.retr(thisNum)在电子邮件包含中文字符时在电子邮件正文中返回= 20.
我该如何处理?
电子邮件的原始文本:
主题:(提单:4363-0192-809.015)SI FOR 15680XXXX436
= 20
亲
= 20
SI封闭
PLS向我们发送BL草案和债务说明
= 20
TKS
= 20
肉豆蔻酸
-----原始消息----- = 20
| 归档时间: |
|
| 查看次数: |
7471 次 |
| 最近记录: |