Hi @Umer Zahoor
If you are trying to send an email on behalf of a personal account, do not use the /{tenant id}
endpoint to request a token, as it only supports organizational identity login. You should use the /common
endpoint to log in to a personal account, and you also need to ensure that your application supports personal account login.
Additionally, if you are sending an email on behalf of an account within an organization (tenant), you will need an enterprise-grade MS 365 license, as accounts within an organization are work accounts.
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.