Attach pdf files and send email

Hello again

I’m building a routine to send my Purchase Orders (P.O) to my provider.
When I create these P.O, they are save in a “TEMP” folder.

I’ve already done the datatable with P.O numbers, and I’ve made a loop to extract the clean P.O. number from the text name.
But here is where I need some help.
How can I do to collect all my P.O. in the DataTable to attach them in the email.
Logically I should include an “IF” to compare the P.O in data table and the P.O extracted from Folder. But I don’t know how to continue from here

Hey @Francisco_Morales,

Iterate through your datatable and get the P.O and then pass the extracted P.O from the datatable to directory file search.Please find the screenshot below for further reference:

1 Like

Thanks @amarasto
With this, the search is easier than I had made.

but now how can attach it, one o many PO to only one email.
If you have any eg?..

Thanks for all your help

Hey @Francisco_Morales,

Please find the workflow attached for the same.

You just need to use invoke code inside your for each loop as is and also dont forget to initialize mailmessage outside the loop.

Attach Multiple Attachments.xaml (11.0 KB)

Hi @amarasto
I wasn’t able to open the file.

At this moment, I only can send one email by row.
And I’m trying when there are more than one registers, send many(n) files in only one email.
I don’t know if is possible with uipath tools.

Hey @Francisco_Morales,

I have attached the workflow again.Let me know if you are able to download and open it.
Attach Multiple Attachments.xaml (11.0 KB)

Assign String= directory.getfiles(path)

Then in smtp we have attachments in that give your String in that AttachmentsCollections Like this2019-07-16%20(4)