使用 python win32com Outlook 清楚地记录了电子邮件功能的阅读 [英] Clearly documented reading of emails functionality with python win32com outlook
问题描述
我正在尝试通过 win32com 更好地了解 Outlook 交互.我一直无法找到明确的文档,让我能够利用 win32com 有效地阅读电子邮件,从我目前的调查来看,这似乎是用户相当普遍的看法.于是出现了以下信息和请求:
I'm trying to understand outlook interaction through win32com better. I've been unable to find clear documentation that allows me to utilise win32com to read emails effectively, from my current investigation it seems like a fairly regular sentiment by users. Thus comes the following information and request:
有人可以吗;
1.提供指向清晰文档位置的链接(如果存在)
2.在下面展开
以下是我根据阅读其他人的代码发现的当前功能.
Below is the current functionality I've found based on reading other peoples code.
获取以下代码:
import win32com
outlook=win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox=outlook.GetDefaultFolder(6)
messages=inbox.Items
for message in messages:
attachments = message.attachments
for attachment in attachments:
pass
上面使用的对象具有以下我所知道的功能:
The objects used above have the following functionality that I'm aware of:
收件箱 -
.Folders
.Items
消息 -
.GetFirst()
.GetLast()
.GetNext()
.GetPrevious()
.Attachments
留言 -
.Subject
.Body
.To
.Recipients
.Sender
.Sender.Address
附件 -
.item()
.Count
附件 -
.filename
如果您知道更多功能,请在您的答案中添加.
If you know of any more functionality then please add to this in your answers.
推荐答案
应用程序参考的 Visual Basic 是您的朋友.尝试从这个链接开始...
The visual basic for applications reference is your friend here. Try starting with this link...
例如,我可以看到该消息可能具有比您在上面列出的属性更多的属性.例如.
For instance I can see that message will probably have additional properties than what you listed above. For example.
- message.CC
- message.Importance
- message.LastModificationTime
这篇关于使用 python win32com Outlook 清楚地记录了电子邮件功能的阅读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!