Save New Attachments for Each New Email and then Attach Saved Attachment to New Outgoing Email

So for each email I am creating a folder named the subject of the email, activity Create Folder as “C:\Users\ReturnA\Desktop\RMA Attachments" + item.Subject.ToString”

Then I save the PDF attachments from that email in the above folder. I do not change the name of the PDF, the PDF come with different names so I leave them as is.

I used a Assign activity and created variable for the path of the above folder, as such RMAPathDoc=“C:\Users\ReturnA\Desktop\RMA Attachments" + item.Subject.ToString”

I used another Assign activity to open each PDF file in that folder, as such PDFFile=Directory.GetFiles(RMAPathDoc, “*.pdf”)

All the above works, but now I want to attach each new PDF from each new folder created above to a new email each time. How do I write the path? I tried “RMAPathDoc*.pdf” and it does not work. See below

Hello @ricardoxh,

You start with this :

PDFFile is an Array of String which contains the full path of all the PDF files in the RMAPathDoc. You can loop over PDFFile using a for each loop and inside the body of the loop send the email with one PDF as attachment.

Hope that helps ! Kudos :slight_smile:

Regards,
Nithin