Hi,
According to the following official documentations , Basic authentication is no longer supported for EWS to connect to Exchange online. To continue to connect and interact with Exchange Online using EWS, developers need write their applications to support OAuth 2.0 – also known as modern authentication.
Authentication and EWS in Exchange | Microsoft Learn
Deprecation of Basic authentication in Exchange Online | Microsoft Learn
You can refer to the following documentation to use OAuth authentication for your EWS application.
Authenticate an EWS application by using OAuth | Microsoft Learn
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.