title: Inserting variables into html body using Send-MailMessage
body: <p>I have no issues sending an HTML email using Send-MailMessage, but is there any way that I can insert the value of a variable?</p>
  
  <p>CSV:</p>
  
  <pre><code>email,samaccountname,newSAM,
  jdoe@amce.com,john.doe,jdoe,
  </code></pre>
  
  <p>Command:</p>
  
  <pre><code>$html = (Get-Content .\email.html)
  Import-Csv .\my-file.csv |
  ForEach-Object {
  Send-MailMessage -SmtpServer 10.0.0.1 -Subject "Subject Here" -From admin@acme.com -To $_.email -Priority: High -BodyAsHtml "$html"
  }
  </code></pre>
  
  <p>HTML Body: </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;HTML Generator Sample Page&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;p&gt;
          &lt;span style="font-family:times new roman,times,serif;"&gt;&lt;span style="font-size: 12px;"&gt;&lt;strong&gt;Old username: $_.samaccountname &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;p&gt;
          &lt;span style="font-family:times new roman,times,serif;"&gt;&lt;span style="font-size: 12px;"&gt;&lt;strong&gt;New username: $_.newSAM &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The email body shows $_.newSAM instead of the value imported from the .CSV file.
  Thanks in advance for any assistance!</p>