Send Outlook emails, making the email activity in the foreground

Hey guys, I have a datatable having two columns, Chapter and Email. I need to send outlook mail to each chapter, adding these email ids in bcc. Alpha and Beta are sample chapters, i have more than 20 different chapters. Eg: I need to send email to Apha adding all the email ids comes in Apha in bcc. Like for all the 20 plus chapters. Please help!

try this maybe it will be some idea for you :slight_smile:
sendEmailCommunity (2).zip (10.6 KB)

1 Like


Hope the below steps would help you resolve this

  1. First let’s get all Alpha chapter data from that datatable
    Let it be of any number of chapters
    But let’s first get the mail of alpha alone and combine those mail ids aim one line

  2. For that use a read range activity and get the data as dt
    Then use a assign activity like this

dt_alpha = dt.AsEnumerable.where(Function(a) a.Field(of String)(“Chapter”).ToString.ToUpper.Equals(“ALPHA”)).Copytodatatable()

and another assign activity like this

dt_beta = dt.AsEnumerable.where(Function(a) a.Field(of String)(“Chapter”).ToString.ToUpper.Equals(“BETA”)).Copytodatatable()

WHERE dt_alpha and dt_beta are datatable variables created in variable panel

  1. Then use a assign activity like this to get all email id in one line with ; as separator

Use a assign activity like this

str_alpha = String.Join(“;”, dt_alpha.AsEnumerable.Select(Function(a) a.Field(of String)(“Email”).ToString.Trim).ToList().ToArray())

Similarly for beta mail I’d in one string

str_beta = String.Join(“;”, dt_beta.AsEnumerable.Select(Function(a) a.Field(of String)(“Email”).ToString.Trim).ToList().ToArray())

Then you can use these string variables in mail activity under BCC property

Cheers @anit.michael

1 Like

Thank you for the help, I tried it out and its working :slight_smile: :+1:

1 Like

Thank you for the help @Palaniyappan :slight_smile: . In my case it isnt possible to create datatable variables for every chapter cos there are “n” number of chapters.

if you found solution please mark ‘solution’ button on my post, thanks of that another people can find answer for similar issue.

Regards :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.