title: send-mailmessage cmdlet does not accept list variable
body: <p>I have a sharepoint list that has a people column - I am trying to write a PS script that would email a person in the people column. Now the problem I am facing is I can't substitute a list variable into the send-mailmessage cmdlet i/e the following does not work:</p>
  
  <pre><code>cls
  if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {
  Add-PSSnapin Microsoft.SharePoint.PowerShell;
  }
  
  $sourceWebURL = "http://sp2k10lab"
  $sourceListName = "miztest"
  $spSourceWeb = Get-SPWeb $sourceWebURL
  $spSourceList = $spSourceWeb.Lists[$sourceListName]
  
  $spSourceItems = $spSourceList.GetItems()
  
  $spSourceItems | ForEach-Object  {
  $_name=$_['name']
  $_email=$_['email']
  send-mailmessage -from "support@XXXXXX" -to $_email -subject    "Regulatory Reminder Notice" -body "Tboooooooooooooooooooooooooitle is overdue by $_diff   days" -priority High -dno onSuccess, onFailure -smtpServer XXXXXXXx        
  } 
  </code></pre>
  
  <p>$_email is where the email address is stored in the list - however - when I try to substitute it into my send-mailmessage cmdlet it does not - the sendmail-message cmdlet works only if I explicitly set an email addy in there i.e the following works</p>
  
  <pre><code>    send-mailmessage -from "support@XXXXXX" -to "foo_miz &lt;'abc@XXXXX.com'&gt;" -subject        "Regulatory Reminder Notice" -body "Tboooooooooooooooooooooooooitle is overdue by $_diff   days" -priority High -dno onSuccess, onFailure -smtpServer XXXXXXX
  </code></pre>
  
  <p>Should I be using a different cmdlet for this purpose - or is this just me being silly with my syntax? </p>
  
  <p>Thanks for any help - would really appreciate a way to do this. </p>