Exchange Web 服务客户端库
Exchange Web 服务客户端库
此模块是 Exchange 邮箱的 ORM,提供对所有数据的 Django 样式访问。它是一个独立于平台、性能良好、行为良好、文档齐全、经过良好测试且简单的界面,用于使用 Exchange Web 服务 (EWS) 与本地 Microsoft Exchange 2007-2016 服务器或 Office365 进行通信。除其他外,它实现了自动发现,以及搜索、创建、更新、删除、导出和上传日历、邮箱、任务、联系人和通讯组列表项的功能。
预告片
exchangelib这是一个如何工作的简短示例。让我们以相反的顺序打印前 100 条收件箱消息:
from exchangelib import Credentials, Account
credentials = Credentials('john@example.com', 'topsecret')
account = Account('john@example.com', credentials=credentials, autodiscover=True)
for item in account.inbox.all().order_by('-datetime_received')[:100]:
print(item.subject, item.sender, item.datetime_received)
文档
文档可在https://ecederstrand.github.io/exchangelib/获得。源代码文档可在https://ecederstrand.github.io/exchangelib/exchangelib/获得。