保存Outlook消息文件(.msg),包括Python中的附件?
我需要在Python的Msg-File中保存Outlook-Mails。当前使用win32com.client
i使用:message.saveas(path + name)
,它为我提供了一个不错的.msg文件,但不包括附件(如果附件存在,则)。使用message.attachments.count
和message.attachments.attachments
可见附件的文件,但是如何创建一个.msg-file,其中包含的附件包含的附件作为一个文件当消息直接从Outlook出口时?
I need to save Outlook-Mails with the attachments in the msg-file in Python. Currently working with win32com.client
I use: message.SaveAs(path + name)
which gives me a nice .msg file, but that does not include attachments (if attachments existent). Attached files are visible using message.Attachments.Count
and message.Attachments
, but how can I create a .msg-file with the attachments included to store as one file which works when messages are exported straight from Outlook?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Outlook对象模型不能为此提供任何内容。可能,您能做的最好的是保存附件的文件以及您的邮件项目(MSG)。使用 attachment.stactment.saveasfile.saveasfile 可以节省的方法指定路径的附件。
The Outlook object model doesn't provide anything for that. Potentially, the best that you could do, is save the attached files along with your mail items (msg). Use the Attachment.SaveAsFile method which saves the attachment to the specified path.