【发布时间】:2017-04-14 01:18:47
【问题描述】:
我正在阅读Python 3 docs here,我一定是盲人或什么的......它在哪里说如何获取邮件正文?
我想要做的是打开一封邮件并在邮件的基于文本的正文中执行一些循环,跳过二进制附件。伪代码:
def read_all_bodies(local_email_file):
email = Parser().parse(open(local_email_file, 'r'))
for pseudo_body in email.pseudo_bodies:
if pseudo_body.pseudo_is_binary():
continue
# Pseudo-parse the body here
我该怎么做?甚至 Message 类是正确的类吗?不是只针对header吗?
【问题讨论】: