connect-to-exchange-mailbox-with-python/3072491 ....私はExchange Onlineに接続して添付ファイルをダウンロードし、Windows上でメールを読むために(Pythonとexchangelibライブラリを使用して)次のリンクを尊重しました。今CentOSで同じタスクを実行したいのですが、手動でexchangelib
ライブラリをダウンロードしてインストールするとします。 私はexchangelibをインポートしようとするたびに、それはのようなエラーがスローされます。問題がある可能性がありますどのようなメールを読んでMicrosoft Exchange Serverから添付ファイルをダウンロードしてください
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "exchangelib/__init__.py", line 2, in <module>
from .account import Account # noqa
File "exchangelib/account.py", line 8, in <module>
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='[email protected]',
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で私を助けてください。
のはなぜですこれはタイトルのcentos/centosでタグ付けされていますか?それはcentos特有ではないようです。 –