Hi @Benard Mwanza ,
You are getting this 401 Unauthorized error because you have not granted microsoft graph permissions to your app instead Office 365 Exachange Online API permissions are granted as per the API permissions screenshot which you shared above.
Please note that you would need to configure the microsoft graph permissions to your app to use Microsoft Graph and below are the steps to be followed to grant Microsoft graph permissions for the registered app in Azure AD.
If you are using application permissions scope in your application then you would have choose "Application Permissons" section from "Microsoft Graph" AP area as shown below
As shown in the above screenshot, Admin must grant admin consent for "Mail.Read" application permissions.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.