i have this powershell script to send emails that set the variable from SSIS packages, but when i add multiple recipients, only the last one gets the mail from SSIS package(i.e. 3 in total) but all recipients receive mail from controlM and ControlM Shout(i.e. 2 in total). I still can't figure it out. Thank you
A. This is where i give name of multiple recipients say file1:
Set-Variable -option Readonly -Force -Name Email_List -Value "abc@gmail.com;def@gmail.com;ghi@gmail.com"
B. This is the powershell script in file2:
[string[]]$SendMail = $Email_List.split(';')
$strcmd += " /SET \Package.Variables[User::ToLine].properties[Value];""" + $SendMail+""" "
C. Here ToLine is the variable from SSIS package In SSIS package Send Mail Task has Expressions as:
ToLine = @[User::ToLine]
((I have tried providing mail in format: (mail1,mail2,mail3), "mail1","mail2","mail3" also in case of powershell
$Email_List.split(;)|%{"<$_>"}
and using join";"))