我在这里阅读 Python 3 文档,我一定是盲人或什么的......它在哪里说如何获取消息的正文?
我想要做的是打开一条消息并在基于文本的消息正文中执行一些循环,跳过二进制附件。伪代码:
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 类是正确的类吗?不只是为了标题吗?