...
Navigate to API Permissions -> click on + to Add a permission and click on Grant admin consent.
Add API Permissions from both Applications and Delegated permissions.
...
As depicted in the below image, Grant admin consent permission for MailSend, MailSendShared, and UserRead.
...