An element node 'soap:Envelope' of the type Element was expected, but node 's:envelope' of type Element was found

194 Views Asked by At

I get this with EWS when I try to get emails from my adresse.

This my code and it was working fine

from exchangelib import Account, Credentials, Configuration, Message, DELEGATE, Mailbox, FileAttachment, HTMLBody, FolderCollection
from exchangelib.protocol import BaseProtocol, NoVerifyHTTPAdapter
from exchangelib.folders import Folder
import warnings



warnings.filterwarnings("ignore")
BaseProtocol.HTTP_ADAPTER_CLS = NoVerifyHTTPAdapter

credentials = Credentials(username='**domain\\XXXXXXXXXX**', password='**XXXXXXXXXXX**')

config = Configuration(server='**XXXXXXXXXXX**', credentials=credentials)
account = Account(primary_smtp_address='**[email protected]**', config=config, autodiscover=False, access_type=DELEGATE)

for email in account.inbox.all().order_by('-datetime_received')[:8]:
    print(str(email.subject))
0

There are 0 best solutions below