【发布时间】:2020-12-28 04:05:23
【问题描述】:
我查看了 python 的电子邮件库,但没有找到任何参考,它建议使用内容类型消息/rfc822 将邮件附加到邮件的方法。
#Message to be attached to new mail
parsed_message = email.message_from_string(str(desearilized_message))
msg = MIMEMultipart()
msg['From'] = "somesender@send.me"
msg['To'] = "somereciver@recive.me"
msg['Subject'] = "Subject of the Mail"
body = "Body_of_the_mail"
msg.attach(parsed_message)
这会导致父邮件的 Content-Type: multipart 而不是 message/rfc822。 关于如何在 python3 中实现它的任何参考/建议?
【问题讨论】:
标签: python python-3.x mime-types email-attachments mime-message