【发布时间】:2014-05-13 15:51:47
【问题描述】:
我正在尝试遍历我的电子邮箱并找到具有特定主题的电子邮件。我正在使用:
import win32com.client
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder(6) # "6" refers to the index of a folder - in this case,
# the inbox. You can change that number to reference
# any other folder
messages = inbox.Items
message = messages.GetLast()
print(message)
body_content = message.body
print body_content
有谁知道我在哪里可以找到这方面的文档。我想使用 GetAll() 函数然后按主题过滤,或者使用 getSubject() 函数,但我根本找不到这方面的文档。任何帮助都会很棒。
【问题讨论】:
-
Python 非常好的自我文档在这里不会帮助你。去找你正在使用的 COM 对象的文档,他们通常有很好看的帮助文件。
-
我在哪里可以找到它?我看起来没有运气