Asif janjua
The error you're encountering seems to be related to the MAPI (Messaging Application Programming Interface) Mail Store on your Exchange server. The error code EcLoginFailure -2147221231 suggests that the user might not have access to a private mailbox or public folder messaging data, there are no private mailboxes or public folders on the server, or the server is exiting or is about to exit.
Here are a few steps you can take to troubleshoot this issue:
Check User Permissions: Ensure that the user has the necessary permissions to access their mailbox. This can be done through the Exchange Admin Center (EAC) or via PowerShell.
Check Mailbox Existence: Verify that the user's mailbox exists on the server. Again, this can be done through the EAC or PowerShell.
Server Status: Check the status of your Exchange server. If it's in the process of exiting or rebooting, it could cause this error. Wait for the server to be fully operational and then try again.
Outlook Version: Ensure that the version of Outlook being used is compatible with your Exchange 2016 server. If it's not, you may need to update or downgrade Outlook.
Recreate Outlook Profile: Sometimes, recreating the Outlook profile can resolve issues with emails getting stuck in the Outbox.
Network Issues: Check for any network connectivity issues between the client machine and the Exchange server.
If none of these steps resolve the issue, it might be worth reaching out to Microsoft Support for further assistance.