I'm working on an app that uses the Microsoft Graph API to send emails via a user's email account, by sending a POST request to https://graph.microsoft.com/v1.0/me/sendMail with a base64-encoded MIME message. I want to be able to allow users to send mail from a shared mailbox. This works in my dev environment with a shared mailbox that I have access to, if I hard-code the "From" field of the message to the shared mailbox address.
My question is: how do I allow users to select a shared mailbox to use when setting up the app? Ideally I'd like to present them with a drop-down list of mailboxes they can access, but there doesn't seem to be any way to find these using the Graph API (although I did spot this feature request). Failing that, is there a way that I can verify that an email address entered by a user is one they are authorised to send mail from (without actually attempting to send an email)? Thanks!