Python EmailMessage()。addAttachment;如何附加ZIP文件?

问题描述 投票:-1回答:1

基本上我的问题是,如何附加.zip存档?

msg.add_attachment(fileToAttachData, maintype=, subtype=, filename="Something")

。zip归档文件的主要类型和子类型是什么?

如果您知道,请告诉我,因为我可能需要.pptx.docx的子类型和主要类型

python python-3.x email email-attachments file-type
1个回答
0
投票

好吧!多亏了mkrieger1的帮助!

我找到了一种找到最多MIME类型的方法!因此,他们在Wikipedia中将其列出。

https://en.wikipedia.org/wiki/EPUB

https://en.wikipedia.org/wiki/Doc_(computing)

在右侧,您可以看到Internet媒体类型为maintype /subtype例如,Word为application/msword

您可以在https://en.wikipedia.org/wiki/Media_type#Common_examples中找到一些常见示例

© www.soinside.com 2019 - 2024. All rights reserved.