Add multiple screenshot in email body

Hi

I have images in a folder and I want to attach all image in email body.
Number of images are dynamic.

Please help

1 Like

Hi @Sana_Afreen

Please refer below link
Hope this helps

Thanks

Hey @Sana_Afreen

Just do Directory.GetFiles and attach all those at once.

Thanks
#nK

Thanks Nithin. But Not able to understand

Hey @Sana_Afreen

What’s the mail activity you are using ?

Thanks
#nK

I am using smtp

1 Like

Can you please tell me step by step

Hey @Sana_Afreen

In the Send SMTP you have attachments collection prop, you can see it ?

Thanks
#nK

Yes I can see

1 Like

I want screenshots in the email body

1 Like

Oh @Sana_Afreen

You want it in email body okay… got it…

So now, What I can understand is @Sana_Afreen

You want to embed images one by one in the email body ?

  1. Use Directory.GetFiles from the image folder

  2. Loop through each file & convert it to base 64

  3. Frame a mail HTML body, one sample - <img src='data:image/gif;base64,/9j/4AAQSkZJRgABAgEAYABgAAD...' />

  4. Pass this body into the mail activity and enable the BodyAsHtml

Hope this helps.

Thanks
#nK

For each item in directory

Inside body what I have to write

1 Like

Hey @Sana_Afreen

You need to do the Step 2 & Step 3

  1. Convert the image to Base 64 string

  2. Frame and append the HTML string as mentioned above

Thanks
#nK

Not able to achieve

How to convert image to base64

Can you please write the code and share it

For each activity Type argument is Object

After than in assign activity what will I write

Hey @Sana_Afreen

Let me write a small sample and share. Thanks
#nK

Thankyou. Waiting. I tried and error is coming.