我正在尝试通过exchangelib MS365并检索我发送的文件夹主题行。以下代码可与account.inbox
轻松配合使用,但不适用于account.sent
。
任何想法:
from exchangelib import DELEGATE, Account, Credentials
creds = Credentials(username='XXXXXXXXXXXXXXX'
, password='XXXXXXXXXXX')
account = Account(
primary_smtp_address='XXXXXXXXXXXX',
credentials=creds,
autodiscover=True,
access_type=DELEGATE)
#for item in account.sent.all()[:5]:
# print(item.subject)
z = account.sent.all()
print([t for t in z[:5]])