python读取微软云盘_从Microsoft Exchange读取电子邮件和下载附件

connect-to-exchange-mailbox-with-python/3072491….我推荐了以下链接,以连接到Exchange Online并在windows上下载附件和阅读邮件(使用Python和exchangelib库)。现在我想在CentOS上完成同样的任务,但是当我手动下载并安装exchangelib库时。

每当我尝试导入exchangelib时,它都会抛出如下错误:Traceback (most recent call last):

File "", line 1, in

File "exchangelib/__init__.py", line 2, in

from .account import Account # noqa

File "exchangelib/account.py", line 8, in

from cached_property import threaded_cached_property

ImportError: No module named cached_property

有什么问题吗?

我的主要目标是阅读和下载电子邮件。没有可用的imap/pop3服务器地址。除了exchangelib还有别的选择吗?from exchangelib import DELEGATE, Account, Credentials

credentials = Credentials(

username='MYWINDOMAIN\\myusername',

password='topsecret'

)

account = Account(

primary_smtp_address='john@example.com',

credentials=credentials,

autodiscover=True,

access_type=DELEGATE

)

# Print first 100 inbox messages in reverse order

for item in account.inbox.all().order_by('-datetime_received')[:100]:

print(item.subject, item.body, item.attachments)

我在Windows中使用过这个代码。帮我学Linux。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值