Sending varied numbers of attachment in Outlook Email

Hi guys, I am working on a flow which sends multiple emails out, with each email attaching the attachments saved in a directory.

I’ve saved all the attachment in a folder path. I am trying to run a “for each” workflow for the invoke method to add attachment to the email. However, I’m not sure what should the “TargetObject” be as shown in the image below:

Parameters of the invoke method:

Can anyone please help, thanks so much!

Hi @annalyy,

Check this post,

1 Like

Hey @piyush.2224 you need to setup the smtp for every single attachment .

Regards Abhik .

Thanks @sarathi125

I notice this post is on SMTP but I’m working on outlook email. I tried but the parameter part shows this:

I wonder if outlook mail works differently?


you can iterate using the files information from that directory and send mail activity like this,
AS per my understanding you want to send each file in a separate mails, so I have used System.IO.FileInfo to loop and sending the file’s full name in the attachment action as a parameter.


1 Like

Thanks @sarathi125

I actually want to send multiple attachments in one email through outlook. How should that work? Thanks!

I am using the workflow below and the file not found exception keeps poping out. However, I’m very sure that the path is correct…any idea? Thanks!!


Main.xaml (12.5 KB)

dynamicattachments.xaml (8.1 KB)


check this attached xaml, we have to pass the parameter to the invoke method. pass file path to that parameter

Hi, I just saw this post with dynamicattachments.xaml,

After you use For Each with MailMessage.Attachments.Add to attach variable numbers of attachments, how do you then proceed to send out the email with the attachments?

I am using Outlook to send the email, not SMTP


Check this attached xaml, debug and check before the Send Outlook mail message activity in the locals tab, you can see that mail message with the attachments. The attachments are picked from the folder you have passed in.

In the send outlook mail message activity we are using the same obj of mailMessage which we have created and added the attachments.

Dynamicattachments.xaml (8.5 KB)