Attach multiple files to send outlook messages

In a list i have the paths of all the files to be attached but I dont know how to attach all of those files to the same email.

2 Likes

Updated @renjith_krishnan

List → dynamicattachments.xaml (9.4 KB)

Array → outlookdynamic-2.xaml (8.9 KB)

8 Likes

Sry that i didnt mention i have the list of paths as an array. And array cannot be passed on to invoke method as an object @vvaidya

Try a bit harder, you will figure it out.

you need to remove inner for each in the code I sent.

We can iterate on list using for each, and read one by one file path and add to a string variable using comma. This can be passed to send mail activities’ attachments part. Mail will be sent with multiple attachments.

I have not tried this, but this seems to be simpler solution if it works… I used Mailmessage attachments in Invoke Method which is an additional step.

string.join(“,”,arrayPath) should be passed into attachments

Hi @suripaleru, quick question - I tried your approach, but keep getting a File Not Found exception when joining all the file paths together.

Aside from the comma, did you use any other characters to separate the individual file paths?

I’ve got @vvaidya’s approach working, but still curious to see if this alternate approach can work too.

Thanks in advance :slight_smile:

@LP_Cigen

@simadri

That not checked but should work i guess. :slight_smile:
but still can i see what you are passing? and what you are not getting? @simadri?

you can check the other thread as well and update here that you are still facing that prob or not.

Regards…!!
Aksh

3 Likes

Hey @simadri

Yes you can do like this way just read the files from a particular directory and use for each on the file array then pass that to to add that item in Mail.Attachments collection in invoke method.
In the example thread link you have to change your directory path from where you want to read all files inside that folder

and you are getting that error because your file path is not correct.
Regards…!!
Aksh

@aksh1yadav Thank you for the suggestion … can you send me a sample xaml file ??? And the path name / file name is correct though .

Thanks in advance…

Regards,
Simadri

you can share yours files and sample xaml i will look into that :slight_smile:

How To Solve This Issues ?

Hey @kirtiSagar

use

MailMessage mailId = New MailMessage

Regards…!!
Aksh

Still Getting the Same Error !!!

mailId is a variable with Microsoft.Office.Interop.Word.MailMessage Variable Type ?

no it should be System.Net.Mail.MailMessage

Still Same Error
I ll Share WorkFlow With You ?HRonboarding.xaml (42.9 KB)

HRonboarding.xaml (43.0 KB)

Use this. there was namespace collision so you can use like System.Net.Mail.MailMessage.

MailMessage mailId = New System.Net.Mail.MailMessage

1 Like

Hello Akash,

I just tried Inovke method from your Workflow, I’m Getting an error in method name

I dont know How to rectify this please Help Me

Ganesh

Gracias, me fue muy Ăştil. :relieved::cowboy_hat_face::muscle:

Hey @Rony_Janampa

Gracias :slight_smile:

Regards…!!
Aksh