To send messages from another user, applications that use user tokens use the Mail.Send.Shared
Microsoft Graph permission.
Addition to this we need to configure mailbox permissions to that other user account.
Steps for giving mailbox permissions:
- Login to M365 admin center-> select active users
- select the user from which you want to send email on behalf
- select Mail in the pane , there you can configure the required permissions
Please refer to the below sample screenshot:
For more details please refer to this documentation.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.