I want to send multiple emails using ‘Send Outlook Mail Message’ activity. I understand I should separate them by ‘;’ in ‘To’ field but that might work when using email addresses in a plain text.
I’m referring to the email addresses by variables from an Excel column (as I’m creating the email addresses dynamically using users first names and last names and concatenating them with ‘@domain.com’), then I want to send emails from another column using also different variables. Any idea on how to do this?
Also, how to add an email address (without using variables) to the mailing list where variables are used?
“To” field on the MailMessage class accepts string format. Have a string variable to hold the addresses - you can build your email addresses using first name last name and append the domain and append “,” to separate the next email address.
string mailTo = string.Join(",", mailId);
It doesn’t matter if you are getting the email IDs from multiple sources; Build your string and then assign it to the To field. Email Test.xaml (8.2 KB)
So it goes through each item in your table variable, and selects the “First Name”."Last Name"@domain.com, which creates an array of all the emails, then String.Join() to concatenate them wtih a “;” inbetween.
Assign that code to a String variable or use directly in the “TO” field of your Send Mail activity