Outlook wont send email from 3rd party invoice program?

a bit wierd problem i run in to.
i have a customer, they do have a invoice program that can automatically use the local email client om the computer to create email, attach a pdf and send them.
This does work with one of the customers email accounts, but when i change the standard account in outlook i just get an error message, [0x80070005-0x0004dc-0x000524].

Both accounts are Office 365, the one working is Business Standard and the one not working is a Echange online license.
The Outlook client in this case is Outlook 2016.
The Error code suggest it is due to permissions on the account, the thing is there is no problem at all sending emails from this account direct from outlook. it is just when sending via the invoice program.

Anny one have any idea what the problem can be?

Is active x controls and those types of automation turned on?

not sure, did forget to mention both outlook and the invoice program is directly on a windows server. connected thru rdp.
and this things did work when they did have IMAP mail, did move them to o365 and it was then the problem starterd.

The question I have for setup is:

Is the invoice program opening outlook creating the email then sending?

Or is invoice program using the mail server to send and simply letting the mail server record the mail in sent items folder so outlook can view it?

The invoice program does open outlook and creating the email.