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:
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.
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?
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.