![](/img/trans.png)
[英]Python read shared Outlook inbox, find text in sub or body, if found, create new folder, or move to existing
[英]How to read email messages from outlook inbox sub folder
import win32com.client
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder(6)
messages = inbox.Items
message = messages.GetFirst()
body_content = message.body
print body_content
我有一个 Outlook 电子邮件帐户。 收件箱有一个子文件夹:调用我想从 python 中的这个子文件夹读取电子邮件消息我正在使用 win32com.client 这里是我正在做的事情。 我可以访问收件箱,但不能访问其中的子文件夹
您可以尝试遍历 Inbox 中的文件夹列表,如下所示:
inbox = outlook.GetDefaultFolder(6).Folders.Item("Your_Folder_Name")
有关更多信息,请参阅此链接:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.