title: SSIS Package 2005 - dynamic ToLine
body: <p>I need to route an email using the Send Mail Task, in SSIS 2005 depending on a variable within a script task.</p>
  
  <p>So, far, I've created a Variable in the variables tab, but can't seem to figure out where to set it, or how to access it using the code. </p>
  
  <p>Apologies for the vague question, but this isn't my bag, and i'm trying to help out another team. I can send through more detail if required.</p>
  
  <p><img src="https://i.stack.imgur.com/wt2Up.png" alt="Script task with a Send Mail Task"></p>
  
  <p><img src="https://i.stack.imgur.com/S21gq.png" alt="Variable within the Variable tab"></p>
  
  <pre><code>Public Function SetEmailAddress(ByVal variable x As String) As String
  if x = y then set the isConfirmation variable.
  </code></pre>
  
  <p>The little code snippet above, is what i'm trying to achieve within the Script Task - process file object.</p>