How to send Multiple Attachments dynamically through Send Mail Activity(UiPath.MicrosoftOffice365.Activities.Mail.SendMailConnection) [Datatype - IEnumerable<IResource>]?

Hi Team,

Can you please assist me in sending Multiple Attachments dynamically through Sen Mail Activity(UiPath.MicrosoftOffice365.Activities.Mail.SendMailConnection), which is Using IEnumerable Collection.

where in For 1 attachment I could able to send by using - new List(Of IResource)From {(UiPath.Platform.ResourceHandling.LocalResource.FromPath(str_FilePath))}

For two - new List(Of IResource)From {(UiPath.Platform.ResourceHandling.LocalResource.FromPath(str_FilePath),(UiPath.Platform.ResourceHandling.LocalResource.FromPath(str_FilePath_1))}

But can I know is there any other way make this dynamic?

Thanks and Regards,
E Sai Prasad

@Eruventi,

If you are going to get dynamic number of attachments, let’s suppose in List use this code to convert it to the required datatype.

listOfFilePaths.Select(Function(filePath) UiPath.Platform.ResourceHandling.LocalResource.FromPath(filePath)).ToList()

Thanks @ashokkarale, shared query is working

Regards,
E Sai Prasad

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.