相关疑难解决方法(0)

使用Python通过MAPI从Outlook中读取电子邮件

我正在尝试编写一个简短的程序,它将读取我的Exchange/Outlook配置文件中的文件夹中的电子邮件内容,以便我可以操作数据.但是我在查找有关python和Exchange/Outlook集成的大量信息时遇到了问题.很多东西要么很老/没有文档/没有解释.我尝试了几个片段,但似乎得到了同样的错误.我试过Tim Golden的代码:

import win32com.client

session = win32com.client.gencache.EnsureDispatch ("MAPI.Session")

#
# Leave blank to be prompted for a session, or use
# your own profile name if not "Outlook". It is also
# possible to pull the default profile from the registry.
#
session.Logon ("Outlook")
messages = session.Inbox.Messages

#
# Although the inbox_messages collection can be accessed
# via getitem-style calls (inbox_messages[1] etc.) this
# is the recommended approach from Microsoft since the
# Inbox can mutate while you're iterating.
# …
Run Code Online (Sandbox Code Playgroud)

python mapi outlook exchange-server cdo.message

40
推荐指数
3
解决办法
10万
查看次数

标签 统计

cdo.message ×1

exchange-server ×1

mapi ×1

outlook ×1

python ×1