I have a target in my build script that will send an email with an attachment detailing svn changes for a module.
This works if I hard code a single email address however I now want to email multiple developers and the script is failing. Below is the code
<Target Name="MailInformationUpdate" DependsOnTargets="ZipArtifact" Condition="!Exists('BUILD_IS_PERSONAL')">
<ReadLinesFromFile File="$(BuildDir)\$(recipientListFileName)">
<Output PropertyName="Recipients" TaskParameter="Lines"/>
</ReadLinesFromFile>
<Mail SmtpServer="$(smptServer)"
To="@(Recipients)"
From="$(senderEmail)"
Body="Attached is a list of the changes made since the last release. "
Subject="This module has been updated. You may wish to update." Attachments="$(BuildDir)\Builds\$(svnChangeFileName)"
/>
</Target>
If I change the To line to read $(Recipients) the first person on the list will get the email, subsequent addresses do not recieve the email.
I then changed the To line to what you see below @(Recipients), as I thougt it might then loop round each recipient. No such luck!!! I get the error message
Emailing "{0}".
<path> error : A recipient must be specified.
The file that I read in is simply a text file in the format (emailAddress1),(emailAddress2), etc