To send email from a shared mailbox with attachments in Power Automate, add the Office 365 Outlook action Send an email from a shared mailbox (V2), set Original Mailbox Address to the shared mailbox, and fill the attachment Name and Content with the output of a SharePoint Get file content action. The account behind the Outlook connection needs Send As permission on the shared mailbox, and several recipients go in the To field separated by semicolons.
Who this is for and what you will build
This guide is for Microsoft 365 admins and flow makers who want reports, invoices or confirmations to come from an address like sales@contoso.com instead of a personal mailbox. You will build a flow that sends one SharePoint file from a shared mailbox, then extend it to attach every file in a folder and the attachments of a SharePoint list item. If you need the opposite direction, saving incoming attachments into a library, see Save Outlook Email Attachments to SharePoint with Power Automate.
Prerequisites
Permissions on the shared mailbox
The flow sends with the permissions of the account that signs in to the Office 365 Outlook connection. The connector reference says that account should have permission to access the mailbox. Exchange Online offers three relevant permissions:
| Permission | What it allows | Can the delegate send? |
|---|---|---|
| Full Access (Read and manage) | Open the mailbox and view, add and remove items | No |
| Send as | Send messages that appear to come directly from the mailbox | Yes, with no sign of the delegate |
| Send on behalf | Send messages that show "Delegate on behalf of Mailbox" | Yes, and the delegate is visible |
Microsoft's shared mailbox guidance says Full Access and Send As are both required for successful shared mailbox operation, and a Microsoft troubleshooting article confirms that Exchange requires Send As to send from a shared mailbox even when Full Access and Send on Behalf are granted. If a user has both Send As and Send on Behalf, Send As is always used.
To grant them in the Exchange admin center, go to Recipients > Mailboxes, select the shared mailbox, open Mailbox delegation, select Edit under Send as and under Read and manage (Full Access), and add the account that will own the flow connection. Send on Behalf isn't available in the EAC for shared mailboxes, so use PowerShell if you need it.
Grant the permissions with PowerShell
In an Exchange Online PowerShell session, these commands give flowsender@contoso.com Send As and Full Access on sales@contoso.com. -AutoMapping $false stops Outlook from adding the shared mailbox to that account's profile automatically.
# Send As: send mail that appears to come from the shared mailbox
Add-RecipientPermission -Identity "sales@contoso.com" -Trustee "flowsender@contoso.com" -AccessRights SendAs -Confirm:$false
# Full Access: open the shared mailbox
Add-MailboxPermission -Identity "sales@contoso.com" -User "flowsender@contoso.com" -AccessRights FullAccess -InheritanceType All -AutoMapping $false
# Check the Send As entry
Get-RecipientPermission -Identity "sales@contoso.com" -Trustee "flowsender@contoso.com"
# Optional: Send on Behalf (shared mailboxes need PowerShell for this)
Set-Mailbox -Identity "sales@contoso.com" -GrantSendOnBehalfTo @{Add="flowsender@contoso.com"}
Permission changes are not instant. The Microsoft 365 admin center documentation says they can take up to 60 minutes, and the connector reference says replication to Power Automate can take about two hours.
Licensing and mailbox requirements
- Office 365 Outlook, SharePoint and OneDrive for Business are Standard connectors in Power Automate, so this flow needs no premium license.
- The connection account needs an Exchange Online mailbox with the REST API enabled; mailboxes on a dedicated on-premises Exchange server can return errors.
- The sender must be a Microsoft 365 shared mailbox. The connector reference says the action is expected to work for that feature only, and an Office 365 group address can't be used as the shared mailbox address.
Step 1: Create the instant cloud flow
- Sign in to Power Automate and select Create > Instant cloud flow.
- In Flow name, enter a name such as Send report from Sales mailbox.
- In Choose how to trigger this flow, select Manually trigger a flow, and then select Create.
You can swap the manual trigger for a scheduled or SharePoint trigger later without changing the send step.
Step 2: Get the file content from SharePoint
- Below the trigger, select the plus sign (+) > Add an action, and choose the SharePoint action Get file content.
- Set Site Address, for example https://contoso.sharepoint.com/sites/sales.
- In File Identifier, browse to the file, for example /Shared Documents/Reports/Monthly-report.pdf.
The action returns File Content as binary. For a file in OneDrive for Business, use that connector's Get file content action and pick the file in File. Both connectors also offer Get file content using path.
Step 3: Add Send an email from a shared mailbox (V2)
- Add the Office 365 Outlook action Send an email from a shared mailbox (V2). If asked to create a connection, sign in with the account that has Send As.
- Fill in the parameters:
| Field | Required | Example value |
|---|---|---|
| Original Mailbox Address | Yes | sales@contoso.com |
| To | Yes | finance@contoso.com;ops@contoso.com |
| Subject | Yes | Monthly sales report |
| Body | Yes | The report for this month is attached. |
| Attachments: Name | Only when attaching | Monthly-report.pdf |
| Attachments: Content | Only when attaching | File Content from Get file content |
| CC, BCC, Reply To | No | Semicolon-separated addresses |
| Importance, Sensitivity | No | Pick from the list |
Attachments is optional, so add it from the action's optional parameters if you don't see it. The Body field is HTML, so you can format the text. This action has no From field: the address in Original Mailbox Address is the sender. Save the flow; it now sends one file from the shared mailbox.
Send to multiple recipients
The connector describes To, CC and BCC as addresses separated by semicolons, so one email reaches everyone listed. Don't wrap the send action in an Apply to each loop for several recipients; that sends a separate message to each person. If the addresses arrive as an array, join them into one string:
join(variables('Recipients'), ';')
Each email counts as one API call per connection regardless of how many recipients it has. Exchange Online's recipient limit per message can be customized up to 1,000.
Attach multiple files with an array variable
The Attachments field can take an entire array instead of a single Name and Content pair. The connector reference documents this as the workaround when multiple attachments arrive as invalid files: initialize an array variable, add each attachment with Append to array variable, then reference the array in the attachments field. This example attaches every file in a SharePoint folder.
- Directly under the trigger, add Initialize variable with Name
EmailAttachments, Type Array and Value[]. Variables can only be declared at the top level, not inside loops or conditions. - Add the SharePoint action List folder and pick the folder in File Identifier. It returns Id, Name and IsFolder for each entry.
- Add Apply to each over the output of List folder. Inside it, add a Condition that checks IsFolder is equal to false, so subfolders are skipped.
- In the True branch, add SharePoint Get file content with this File Identifier:
items('Apply_to_each')?['Id']
- Still in the True branch, add Append to array variable, select
EmailAttachments, and enter this Value:
{
"Name": "@{items('Apply_to_each')?['Name']}",
"ContentBytes": "@{body('Get_file_content')?['$content']}"
}
- After the loop, add Send an email from a shared mailbox (V2). Use the toggle beside Attachments to switch it to an entire array, and enter:
variables('EmailAttachments')
Details that matter:
- Name and ContentBytes are the attachment keys the connector defines. Keep the capitals.
- Binary content in a flow is carried as an object with
$content-typeand$contentproperties, where$contentis the base64 string that ContentBytes expects. - Expressions use internal action names, with spaces replaced by underscores. If your loop is called For each, change
Apply_to_eachtoFor_each. - When a loop changes a variable, Microsoft says the iterations must run sequentially for predictable results. That's the default, so leave concurrency control off.
To inspect the array, add a Compose action after the loop with variables('EmailAttachments') as its input and read its output in the run history.
Send attachments from a SharePoint list item
To email the files attached to a list item, only the source of the files changes.
- Use the SharePoint trigger When an item is created, and initialize
EmailAttachmentsas before. - Add SharePoint Get attachments with Site Address, List Name and the item's ID from the trigger in Id.
- Add Apply to each over its output. Inside, add Get attachment content with the same site, list and item ID, and this File Identifier:
items('Apply_to_each')?['Id']
- Add Append to array variable with this value:
{
"Name": "@{items('Apply_to_each')?['DisplayName']}",
"ContentBytes": "@{body('Get_attachment_content')?['$content']}"
}
- After the loop, pass
variables('EmailAttachments')to Attachments as an entire array, and use list columns from the trigger for To and Subject.
The SharePoint connector supports list item attachments up to 90 MB, but email limits are much lower, so oversized files fail at the send step.
Test the flow
- On the designer toolbar, select Test.
- In the Test flow pane, select Manually, and then select Test.
- In the Run flow pane, select Run flow, and then select Done.
Confirm that the message shows sales@contoso.com as the sender, that every recipient got the same single message, and that each attachment opens with the right name and extension. The flow details page keeps a 28-day run history where you can open each action's inputs and outputs. For a walkthrough of failed runs, see Power Automate Flow Failed: Read Run History and Fix Common Errors.
Alternative: Send an email (V2) with From (Send as)
The regular Send an email (V2) action has an optional From (Send as) field, which the connector says requires Send as or Send on behalf of permission for that mailbox. Put the shared mailbox address there; Attachments works the same way.
| Shared mailbox action | Send an email (V2) with From | |
|---|---|---|
| Sender set in | Original Mailbox Address (required) | From (Send as) (optional) |
| Permission | Access to the shared mailbox, with Send As | Send As or Send on Behalf on the From address |
| Recipient sees | The shared mailbox | The mailbox, or "on behalf of" with Send on Behalf |
Use the shared mailbox action when the sender is always a shared mailbox. Send an email (V2) is worth testing for distribution groups, or when the shared mailbox action hits the converted-mailbox limitation below.
Limits to plan for
| Limit | Value | Source |
|---|---|---|
| Maximum mail content length | 49 MB | Outlook connector |
| Send an email content per connection | 500 MB per 5 minutes | Outlook connector |
| API calls per connection | 300 per 60 seconds | Outlook connector |
| Default mailbox send size | 35 MB (admins can set 1 MB to 150 MB) | Exchange Online limits |
Messages that leave Microsoft's datacenters are subject to an extra 33 percent encoding increase, so a message near the limit can still fail for external recipients. For large files, send a sharing link instead. The connector also retries a 504 timeout up to four times, which can produce duplicate emails.
Common errors and fixes
ErrorSendAsDenied (403 Forbidden)
The message reads: "The user account which was used to submit this request does not have the right to send mail on behalf of the specified sending account." The connection account lacks Send As and Send on Behalf on the sender address. Grant Send As, wait for replication, and rerun.
Specified object was not found in the store
Microsoft's checks: verify the account's permissions, verify that the connection account is a member of the shared mailbox, verify that Original Mailbox Address holds the shared mailbox address, re-check the shared mailbox in the admin center, and delete and recreate the Outlook connection.
The action fails for a former user mailbox
The connector reference says Send an email from a shared mailbox (V2) does not work for shared mailboxes converted from personal mailboxes. If yours was converted, as described in Convert a user mailbox to a shared mailbox, test Send an email (V2) with From (Send as).
Parameter 'Attachment Content' cannot be null or empty
Content received nothing, usually because the dynamic content came from a different loop or a skipped action. Microsoft's guidance is to use an expression that encodes the attachment as base64; for SharePoint output, body('Get_file_content')?['$content'] already holds that string. Check that Get file content actually ran.
Attachments arrive but can't be opened
Use the array variable pattern, check the capitals in Name and ContentBytes, and make sure each Name includes the file extension, such as .pdf.
Item ID doesn't belong to current mailbox
Flows built before shared mailbox support arrived on May 6, 2020 must be updated to specify the shared mailbox address explicitly.
REST API is not yet supported for this mailbox
The connection account's mailbox is on a dedicated Exchange server or isn't a valid Microsoft 365 mailbox. Use an account whose mailbox is in Exchange Online.
Checklist
- Sender is a Microsoft 365 shared mailbox, not a group address.
- Connection account has Send As and Full Access, and replication time has passed.
- Original Mailbox Address holds the shared mailbox address.
- Recipients are separated by semicolons, with no loop around the send action.
- Multiple attachments use an Array variable of Name and ContentBytes objects, passed as an entire array.
- The loop that appends to the variable runs sequentially.
- Total message size stays under 35 MB unless an admin raised the limit.
- A test run confirms the sender, recipients and readable attachments.
References
- Office 365 Outlook connector: https://learn.microsoft.com/en-us/connectors/office365/
- SharePoint connector: https://learn.microsoft.com/en-us/connectors/sharepointonline/
- OneDrive for Business connector: https://learn.microsoft.com/en-us/connectors/onedriveforbusiness/
- Create a shared mailbox: https://learn.microsoft.com/en-us/microsoft-365/admin/email/create-a-shared-mailbox
- Give mailbox permissions to another user: https://learn.microsoft.com/en-us/microsoft-365/admin/add-users/give-mailbox-permissions-to-another-user
- Manage permissions for recipients in Exchange Online: https://learn.microsoft.com/en-us/exchange/recipients-in-exchange-online/manage-permissions-for-recipients
- Can't send email when Full Access is granted to a shared mailbox: https://learn.microsoft.com/en-us/troubleshoot/exchange/mailflow/cannot-send-email-with-full-access
- Add-RecipientPermission: https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/add-recipientpermission
- Add-MailboxPermission: https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/add-mailboxpermission
- Send Outlook messages from another user: https://learn.microsoft.com/en-us/graph/outlook-send-mail-from-other-user
- Troubleshoot Outlook email in Power Automate: https://learn.microsoft.com/en-us/power-automate/email-troubleshooting
- Variables in Power Automate: https://learn.microsoft.com/en-us/power-automate/create-variable-store-values
- Expression functions reference: https://learn.microsoft.com/en-us/azure/logic-apps/expression-functions-reference
- Handle content types in workflows: https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-content-type
- Get started with cloud flows: https://learn.microsoft.com/en-us/power-automate/get-started-with-cloud-flows
- Format date and time values in a flow: https://learn.microsoft.com/en-us/power-automate/date-time-values
- Exchange Online limits: https://learn.microsoft.com/en-us/office365/servicedescriptions/exchange-online-service-description/exchange-online-limits
This guide was researched and drafted with AI assistance and checked against the vendor documentation listed in its References. Read the maintained version and related guides on EpiFive.
Top comments (0)