2017-10-16 57 views
0

我保存附件使用Anaconda2-5.0.0-Windows的x86_64的,Python2.7,exchangelib 1.10.4如何使用exchangelib

我试图拯救所有的电子邮件附件,从Exchange帐户。看起来我可以毫无问题地连接到帐户,但每次尝试运行整个过程时,都会给我一个错误消息。这里是一个我曾尝试代码:

mailbox = account.inbox 

for msg in mailbox.all(): 
    for attachment in msg.attachments: 
     fpath = os.path.join(r'C:\temp', attachment.name) 
     with open(fpath, 'wb') as f: 
      f.write(attachment.content) 

我得到的错误是:

的“FieldURI”属性无效 - 值“项目:IsAssociated”无效,根据其数据类型'http://schemas.microsoft.com/exchange/services/2006/types:UnindexedFieldURIType' - 枚举约束失败。

该收件箱中的邮件包含CSV文件附件,邮箱当前有23条邮件存储。

回答