公司升级了outlook MFA认证,
python的exchangelib 报错
from exchangelib import DELEGATE, Account, Credentials, Message, Mailbox, HTMLBody,FileAttachment,Configuration,NTLM
from exchangelib.protocol import BaseProtocol,NoVerifyHTTPAdapter
BaseProtocol.HTTP_ADAPTER_CLS = NoVerifyHTTPAdapter
def Email(to,cc_mail,subject, body, attachmentspath=None):
creds = Credentials(
username='xxx@bbbb.com', # 账号
password='**********' # 密码
)
account = Account(
primary_smtp_address='xxx@bbbb.com', # 发送方邮箱地址
credentials=creds,
autodiscover=True,
access_type=DELEGATE
)
m = Message(
account=account,
cc_recipients=cc_mail,
subject=subject,
body=HTMLBody(body),
to_recipients=[Mailbox(email_address=to)]
)
报错
raise AutoDiscoverFailed(
exchangelib.errors.AutoDiscoverFailed: All steps in the autodiscover protocol failed for email xxx@bbbb.com. If you think
this is an error, consider doing an official test at https://testconnectivity.microsoft.com