How to Send an Email with Attachments in Power Automate? [From SharePoint & OneDrive]

Do you want to attach a single file or multiple files to an email you send from Power Automate? Then this Power Automate tutorial is for you. I will explain how to send an email with attachments in Power Automate.

Here we will cover two examples: First, we will see how to send an email with single or multiple attachments from a SharePoint Online list in a flow in Power Automate.

Secondly, we will learn how to send an email with an attachment or with multiple attachments from OneDrive in Power Automate.

Send an Email with Attachments from SharePoint list using Power Automate

Using Microsoft Flow, let us see how to send an email with single and multiple attachments from a SharePoint list.

The Power Automate flow that we will create now supports sending an email with a single attachment and multiple attachments from the SharePoint list.

Scenario:

The flow triggers automatically when a new item is created with an attachment in a SharePoint list. Later, using the Get Attachments action, it retrieves the attachments for the particular list item, and finally, by using Send an email (v2) action, it sends an email to the corresponding user in Powe Automate flow.

To achieve this, follow the below steps:

Step-1:

Create a SharePoint Online List. Here I have created a SharePoint List called Employee Documents consisting of,

  • EmployeeID – Default Title column
  • EmployeeName – Person or Group column
  • EmployeeDesignation – Single Line of Text
  • Attachments – default attachment column
How to send an email with attachments in Power Automate

Step-2:

  • Our SharePoint list is created, so now we will create a flow to send an email with attachments from the SharePoint list.
  • Log in to Power Automate flow using the credentials, and select +Create -> Automate cloud flow.
  • Enter the flow name, choose the trigger when an item is created, and click the create option.
How to send an email with attachments in Power Automate flow

Step-3:

Expand the trigger action and configure the SharePoint site address and List Name. I have selected my site address and SharePoint list called Employee Documents.

send an email with attachments from sharepoint list in Power Automate flow

Step-4:

  • Select the +new step and select Initialize variable action, Enter the variable name, and choose the variable type as Array to save the attachments. Leave the Value field blank.
  • Later we will use the initialized variable in our flow.
send an email with attachments from sharepoint list in Power Automate

Step-5:

  • Add a Delay action from action triggers and set the count as 15 and the unit as seconds. Here we are delaying action to retrieve all the attachments from the SharePoint list without fail.
  • Because sometimes it takes time to upload, we are setting a delay action to retrieve all the attachments from the SharePoint list item without missing any attachments.
Send email with attachment from SharePoint list using Power Automate

Step-6:

Select the Get Attachments action to get all the attachments from the SharePoint list. Configure the SharePoint site address and list name. Add the ID value from the dynamic content value.

Power Automate send email with attachments fom SharePoint list

Step-7:

  • Select the next step and then choose Get attachment content to read all the contents. Configure the SharePoint site address, list name, and ID.
  • In the File identifier, add the id of getting attachments from the dynamic content, it will automatically add Apply to each control to get the attachment content for the SharePoint list item.
Send email with multiple attachments from SharePoint list using Power Automate

Click on the next step, select Append to array variable action, and select the initialized variable called Attachments (ie: Step-4:) from the dropdown. In the value field, pass the below JSON code.

{
"Name":@{item()?['DisplayName']},
"ContentBytes":@{body('Get_attachment_content')}
}
Power Automate Send email with attachment from SharePoint list

Step-8:

  • Select Send an Email V2 outlook action from action triggers; enter the recipient’s email in the To field.
  • Provide the Subject and Body of the mail. Expand Show Advanced options.
Power Automate Send email with multiple attachments from SharePoint list
  • In the attachment section, click on the icon to switch to the entire array of attachments.
  • Select the initialized Variable name from the dynamic content value with all the attachments.
Power Automate Send email with attachment from SharePoint Online list

Step-9:

Save and Run the flow, by selecting the run flow option. The flow will trigger only when we create a new item in the SharePoint list.

Case-1: Send an email with an attachment from SharePoint list using Power Automate

Here in the SharePoint list, I have created a list item with a single attachment as highlighted below:

Send mail with attachments fom SharePoint list using the flow

Once our flow runs successfully, like below:

Send mail with attachments fom SharePoint list using flow

Now, The mentioned user will get an email with a single attachment from the SharePoint list as shown below:

Power Automate Send email with multiple attachments from SharePoint list

Case-2: Send an email with multiple attachments from SharePoint list using Power Automate

Now I have created a list item with 3 attachments as highlighted below:

Power Automate send email with multiple attachments fom SharePoint list

Once our flow runs successfully, The mentioned user will get an email with all the 3 attachments from the SharePoint list, as shown below:

How to send email with multiple attachments fom SharePoint list in Power Automate

This is how to send an email with a single attachment and Multiple attachments from a SharePoint list using a Flow.

Send an email with an attachment from OneDrive in Power Automate

Here we will see how to send an email with a single attachment and Multiple attachments from OneDrive using a flow in Power Automate.

Example-1: Send an email with an attachment from OneDrive using Power Automate

Let us see how to send an email with a single attachment from OneDrive using Flow.

Scenario:

The flow triggers automatically when a new file is uploaded to the Documents in OneDrive. Later, using the Get File Content, it retrieves the attachment, and finally, by using Send an email (v2) action, it sends an email to the mentioned user in Powe Automate flow.

To achieve this, Follow the below steps:

Step-1:

Here I have created one New Folder in OneDrive called Employee Documents as shown below:

Power Automate send email with attachments from OneDrive

Step-2:

  • Log in to Power Automate flow using the credentials, and select +Create -> Automate cloud flow.
  • Enter the flow name, choose the trigger when a file is created, and click the create option.
Power Automate send email with attachments from OneDrive

Step-3:

Expand the trigger action and select the Folder from the Show Picker. Here I have selected the Employee Documents.

Send an email with an attachment from OneDrive in Power Automate

Step-4:

Add Get File content action to get attachment content. In the File field, pass the dynamic content value of the File Identifier.

Power Automate send email with attachment from OneDrive

Step-5:

  • Select Send an Email V2 outlook action from action triggers; enter the recipient’s email in the To field.
  • Provide the Subject and Body of the mail. Expand Show Advanced options.
  • In the Attachments Name, Pass the dynamic content value of the File Name. In the Attachment Content, pass the dynamic File content value.
Power Automate send email with multiple attachments from OneDrive

Step-6:

Save and run the flow by selecting the Run flow option. The flow will only trigger when a file is created in OneDrive. I have uploaded a file to the Employee Documents folder presented in OneDrive.

Power Automate sends an email with an attachment from OneDrive

Now our flow runs successfully like below:

Power Automate sends an email with an attachment from OneDrive Folder

The mentioned user will get an email with a single attachment from OneDrive as shown below:

Send email with attachment from OneDrive using Power Automate

This is how to send an email with a single attachment from OneDrive using Flow.

Example-2: Send email with multiple attachments from OneDrive using Power Automate

Here we will see how to send an email with Multiple attachments from OneDrive using Flow.

Scenario:

The flow triggers manually; initially, the List all the Files action gets all the files presented in the OneDrive folder. Later, using the Get File Content action, it retrieves the content of all attachments. And finally, by using Send an email (v2) action, it sends an email to the corresponding user in Powe Automate flow.

To achieve this, Follow the below steps:

Step-1:

Select the OneDrive folder to send the user all the files presented in the folder as email attachments. Here I am going to use the Employee Documents folder has 3 different attachments as highlighted below:

send email with Multiple Attachments from OneDrive using flow

Step-2:

  • Log in to Power Automate flow using the credentials to create a flow, and select +Create -> Instant cloud flow.
  • Enter the flow name, choose the trigger as manually trigger a flow, and click the create option.
Send email with attachment from OneDrive using Power Automate

Step-3:

  • Select the +new step and select initialize variable action; enter the variable name and choose the variable type as Array to save the attachments. Leave the Value field blank.
  • Later we will use the initialized variable in our flow.
How to send email with Multiple Attachment from OneDrive using flow

Step-4:

Add a new step and choose List files in folder action. Select the Folder from the Show Picker. Here I have selected the Employee Documents.

Send email with multiple attachments from OneDrive using Power Automate

Step-5:

  • Choose the Get file content action, to read all the attachment’s content based on the ID. Pass the dynamic content Id value.
  • It will automatically add Apply to each control to get the attachment content from OneDrive.
How to send email with Multiple Attachment from OneDrive using Power Automate

Click on the next step, select Append to array variable action, and select the initialized variable called Attachments (ie: Step-3:) from the dropdown. In the value field, pass the below JSON code.

{
  "Name":@{items('Apply_to_each')?['DisplayName']} ,
  "ContentBytes": @{body('Get_file_content')}
}
send email with Multiple Attachment from OneDrive using Power Automate

Step-6:

  • Select Send an Email V2 outlook action from action triggers; enter the recipient’s email in the To field.
  • Provide the Subject and Body of the mail. Expand Show Advanced options.
Send email with multiple attachments from OneDrive using Power Automate
  • In the attachment field, click on the icon to switch to the entire array of attachments.
  • Select the initialized Variable name from the dynamic content value with all the attachments.
Power Automate send email with multiple attachments from OneDrive

Step-7:

Save and Run the flow by selecting the run flow option. Once the flow runs successfully, like below:

Power Automate send email with attachment from OneDrive

It gets all the 3 files presented in the Employee Documents folder in OneDrive and sends an email with multiple attachments to the mentioned user.

Power Automate send email with multiple attachments from OneDrive

This is how to send an email with multiple attachments from OneDrive using Flow. This is how to send an email with single and multiple attachments from OneDrive using Power Automate.

Conclusion

We can easily send email attachments while sending using Email in Power Automate. I have explained how to send emails with attachments in Power Automate from SharePoint. And also, I have shown you how to send an email with attachments from OneDrive using Power Automate.

You may also like:

>