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!
Hey,
try this maybe it will be some idea for you
sendEmailCommunity (2).zip (10.6 KB)
Hi
Hope the below steps would help you resolve this
-
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 -
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
- 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
Thank you for the help, I tried it out and its working
Thank you for the help @Palaniyappan . In my case it isnt possible to create datatable variables for every chapter cos there are ânâ number of chapters.
Hey,
if you found solution please mark âsolutionâ button on my post, thanks of that another people can find answer for similar issue.
Regards
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.