2

I have an application that uses Microsoft Graph API to receive and send emails from multiple shared mailboxes. The application authenticates itself using OAuth to an App in our Azure Active Directory that has Application type access to the following: Application permissions

Sending replies and making new emails from the mailboxes works just fine. However, I now need to be able to send an email on behalf of the shared mailbox and that doesn't seem to want to work.

For example (all id's and names are entirely fictional);

I receive emails from the shared mailbox "info@something.com" like this: GET https://graph.microsoft.com/v1.0/users/info@something.com/mailFolders/Inbox/messages

Then when i want to reply to an email i reply like this: POST https://graph.microsoft.com/v1.0/users/info@something.com/messages/dc90ed89-f897-4516-96c7-e25e1d37eec1/reply with the body:

{
    "message": {
        "toRecipients": [
            {
                "emailAddress": {
                    "name": "Someone",
                    "address": "someone@someplace.com"
                }
            }
        ],
        "attachments": [],
        "sender": {
            "emailAddress": {
                "name": "bob",
                "address": "bob@something.com"
            }
        }
    },
    "comment": "Some mail html here"
}

Bob wants to send an email on behalf of the shared mailbox, however; the "sender" gets changed to the shared mailbox when it sends. I suspect this is because it is sent from the context of the shared mailbox. But i can't access the message any other way, only through the context of the shared mailbox.

Bob has all rights to send on behalf of the shared mailbox.

I've also tried to give "Send as" rights to the shared mailbox for Bob, but this also doesn't seem to work.

Is there some way I can send an email as bob on behalf of the shared mailbox? Or is the only way by authenticating myself as Bob and then send it the way i have tried?

Artemis
  • 21
  • 1

0 Answers0