Send outlook attachments issue

Hi Team,

Need help in attaching files from 2 different folders (Success and Fail)
Both the folders have .png files. while sending Send Outlook Mail Message activity in AttachmentsCollection using Test_Fail variable which contains all failed screenshots.png i want to attached another variable Test_Success variable which has passed screenshots. To test my luck just tried Test_Fail, Test_Success in AttachmentsCollection getting error Test_Success not accessible looks like there is another way

Hi @Honda

If variable1 and variable2 are array of files

Just try passing variable1.Concat(variable2).toarray

If it helps do mark it as a solution!

Hi @Honda

store the file paths in two arrays: Test_Success and Test_Fail. in the AttachmentsCollection property. combine both arrays, use the expression Test_Fail.Concat(Test_Success).ToArray

Happy Automation

Try to pass the files name saperated by semicolons @Honda
Also show the screen shot if possible how u r passing and what error you are getting

In UiPath, you can easily add multiple attachments in the “Send Outlook Mail Message” activity by using the AttachmentsCollection property.

How to Add Multiple Attachments:

  1. Prepare the list of attachment file paths:

attachments = New List(Of String) From {
“C:\Files\Report1.xlsx”,
“C:\Files\Report2.pdf”,
“C:\Files\Image1.png”
}

This variable (attachments) should be of type:

System.Collections.Generic.List(Of String)

  1. Assign this list to the AttachmentsCollection property:

In the “Send Outlook Mail Message” activity:

Find the AttachmentsCollection property in the Properties panel.

Mark solution its help happy Automation :blush: