我有多封包含附件的电子邮件。我想下载带有特定主题行的未读电子邮件附件。
例如,我收到一封主题为“EXAMPLE”并包含附件的电子邮件。那么它会如何下面的代码,我试过但它不工作”这是一个 Python 代码
#Subject line can be "EXAMPLE"
for subject_line in lst_subject_line:
# typ, msgs = conn.search(None,'(UNSEEN SUBJECT "' + subject_line + '")')
typ, msgs = conn.search(None,'("UNSEEN")')
msgs = msgs[0].split()
print(msgs)
outputdir = "C:/Private/Python/Python/Source/Mail Reader"
for email_id in msgs:
download_attachments_in_email(conn, email_id, outputdir)
HUH函数
小怪兽爱吃肉
长风秋雁
临摹微笑
相关分类