How to send single or multiple invoices to multiple mails (eg: I have to send (invoice 1 , invoice 3, invoice 4 ) to Mail id 1 and (invoice 2, invoice 5) to mail id 2 and so on

I have used split and stored it in datatable, From there I have to send email with single or multiple attachments in a single flow.

please follow

please follow these steps,
1- make a folder where you collect all files for specific Email
2- After collecting all files in folder,
3- attach these files mail.
4-repeat these steps for each email.

Hi Manasa,

  1. Get the row for which you have to send the email.
  2. On Attachment column for that row use split and convert it to List–>
  3. This step is optional if attachment column contains full path instead of relative path:
    Loop through list and concat the path to get full path.
  4. Pass the attachment list to the AttachmentsCollection field of Send Outlook Mail Message

Uploading the solution. (3.7 KB)

Hi mshahidakhtar,

Thanks for replying . Problem is ,

  1. It should read from excel and if there is more than 1 attachment in the cell, it should split and store it in datatable
    2.After storing , It should send the splitted attachments to the corresponding emails on a loop.
    (attachment number should not matter it can be 1pdf or 3 pdf or 5 pdf)
    Please find my code and help me to enhance it
    Main.xaml (43.0 KB)

@raja.arslankhan I am able to send multiple attachments for single email. But how can I attach multiple different invoices for multiple different companies from same folder

make a folder, after splitting files string, place all files in folder than attach all files corresponding Email.
For Second Iteration delete all files from folder place for second then attach.
repeat till end

@mshahidakhtar I have to send (INVOICE (1).pdf, INVOICE (5).pdf, INVOICE (7).pdf) to ; (INVOICE (2).pdf, INVOICE (9).pdf) to and so on in a loop.

Please do the needful.

Hi Manasa,

I have made the changes.
Please check.

Main.xaml (42.9 KB)

1 Like


Hi I checked the code.
For mail1 its sending correctly but for mail2 its fetching (mail1 pdfs + mail2pdfs)

@Manasa_Devi In loop body end of your all activities you can make your collection Nothing