Bug - The expected XML node type was Element - EndElement

Hello,

I’m currently having trouble with the synchronization of my Office 365 Exchange account on eM Client.

I’ve looked it up on other topics but can’t find any other solution than delete and readd my account to the client but I’m quite afraid I’m gonna lose my files because I don’t even know if it’s stored on my computer or my email server.

I’m relatively limited in my technical knowledge so I tried getting the help of Copilot to solve this even if I’m not fond of IA. It made me try several tests and seemed quite helpful in getting the diagnostic more precise with each test.

In the end here is what it tells :

I’m using eM Client 10.4.5642 on macOS with a Microsoft 365 Exchange account.

I am getting the following error:

“The expected XML node type was Element, but the actual type is EndElement.”

After several tests, I noticed something interesting:

  • Emails sent from eM Client are actually delivered successfully.

  • Recipients receive them without any issue.

  • The messages appear correctly in Outlook Web under “Sent Items”.

  • However, eM Client reports the send operation as failed and keeps the messages in the Outbox.

The latest logs show the exception during:

EmailMessage.SendAndSaveCopy(…)

ExchangeService.InternalCreateItems(…)

and also:

Microsoft.Exchange.WebServices.Data.ServiceXmlDeserializationException:

The expected XML node type was Element, but the actual type is EndElement.

I have already:

  • Moved recent emails out of the Inbox.

  • Removed suspicious emails.

  • Deleted all Drafts.

  • Emptied Deleted Items.

  • Restarted eM Client.

The issue remains.

Since the emails are successfully sent and saved in Sent Items on Microsoft 365, it looks like Exchange completes the operation successfully but eM Client fails while parsing the EWS response and therefore considers the operation failed.

Has anyone experienced this issue before?

Is there a way to rebuild or reset the local cache for a single Exchange account on macOS without removing and recreating the account?

Thanking you in advance for any indication,

I hope I’ll be able to repair it because I really like using eM Client and I really don’t want to go back to Mac Mail where I had a terrible experience and even worse if I have to work everyday with the Outlook app …

I am getting the following error:

“The expected XML node type was Element, but the actual type is EndElement.”

I’m using eM Client 10.4.5642 on macOS with a Microsoft 365 Exchange account

I’ve looked it up on other topics but can’t find any other solution than delete and readd my account to the client but I’m quite afraid I’m gonna lose my files because I don’t even know if it’s stored on my computer or my email server.

Yes recommend to try remove and readd your account via “Menu / Accounts” for that error as that normally fixes that error.

For a MS Office 365 Exchange account “all your your emails are stored on the server end” so all your emails, contacts, tasks etc will normally come back when you re-add the account.

It’s only if you have messages stored in Local Folders at the bottom left of eM Client that you have to export them first to (.eml) messages via “Menu / File / Export” to then import later.

If removing and re-adding the account “only temporarily fixes it” and keeps happening, then if you installed eM Client originally from the website, try upgrading to the latest V10.4.5663 via the release history page and see if that fixes it just released in the last day. If you do try the update, make a backup first via “Menu / Backup” incase you need to restore for any reason.

Also If the email body or headers contains any eg: special symbols (like $ ) or characters that are not XML-compliant, the parser will fail. So try sending “a plain text test email” to confirm if the email content is causing this issue.

If none of the above makes no difference or it keeps happening, then if you have a current active paid Pro, Personal or Business version go to the VIP support page and login and lodge a support ticket to be investigated. if you have run out of your 12 months support, you can get another year extra the following page VIP Support Extension | eM Client

Hi cyberzork, thanks for your answer.

I actually have a lot of folders at the bottom left with all my classification for the treated mail. I was never really sure if that was synced with Microsoft so that’s good to know, I’ll make a save export just in case.

I saw yesterday that there was a more recent update so I upgraded my client and I’m now at 10.4.5663. It worked fine but I still had the synchronisation problem after.

When I was looking for a mail that could have caused trouble yesterday I found one of a professionnal newsletter which had been badly sent and had lines like :

« Spéciale abonnés Légi %IF $TYPE_ABONNEMENT == ‘MAX’ %Max%/IF% %IF
$TYPE_ABONNEMENT == ‘ILLIMITE’ %Max%/IF% %IF $TYPE_ABONNEMENT ==
‘DEMO’%Démo%/IF% »

With another one in my Draft which acted strange with like 20 versions in Draft, that was the two main suspects for me. At the end yesterday I deleted them and a lot of other things just in case. It still didn’t work.

This morning when I started the computer everything on eM Client worked smoothly. No more red triangle, everything that happened yesterday on Outlook web is now here in good order.

So I’ll keep the readding solution and cross my fingers that I won’t need to test it and that the sync will keep working ! I think maybe it was one of the mail I suspected yesterday but I cannot really be sure.

Thanks for these informations, I understand better how it works since it has always been a bit of a blur for me.