private MailMessage ConfigureMessage(IReportTaskRunContext taskContext, string filename) { var msg = new MailMessage { From = new MailAddress(fromAddress), Subject = filename }; msg.AddRecipientsFromGroup(addresses); if (!string.IsNullOrEmpty(RecepientsDatasetName)) { msg.AddRecipientsFromPackage(taskContext.Packages[RecepientsDatasetName]); } return(msg); }