title: importing HTML and outputting with variables
body: <p>I'm looking for a method to import a template HTML file in PowerShell and being able to populate it with variables, which in turn sends an e-mail in HTML format containing user data.</p>
  
  <p>I already know how to send the HTML e-mail. And, currently have HTML in a 'here' string embedded in the code. I want to take it a step further, by being able to grab an HTML template based on country code. So, if the user is in the US, it'll get a English HTML data filled e-mail, if they're dutch, they'll get it in Dutch, etc.</p>
  
  <pre class="lang-bsh prettyprint-override"><code>function SendMessage {
      Param(
          [Parameter(Position=0,Mandatory=$true)]
          [string]$Identity,
          [Parameter(Position=1,Mandatory=$true)]
          [string]$Body
      )
  
      $Subject = "Important information - Do not delete this email. Welcome to Voicemail"
      $SmtpClient = New-object system.net.mail.smtpClient    
      $MailMessage = New-Object system.net.mail.mailmessage
      $CredentialFile = ".\UMcloud-creds.txt"
  
      $password = Get-Content $CredentialFile| ConvertTo-SecureString -Force    
      $UMCloudAdmin = ""
      $SmtpClient.Credentials = New-Object System.Net.NetworkCredential($UMCloudAdmin, $Password)
      $smtpclient.Host = "smtp-in.net"
      $MailMessage.From = "Voicemail &lt;P@domain.net&gt;"
      $MailMessage.To.clear()
      $MailMessage.To.Add($Identity)
  
      $MailMessage.Subject = $Subject
  
      $Mailmessage.Body = $body
      $MailMessage.IsBodyHtml = 1    
  
      $Logofilepath = ((Resolve-Path .\).Path) + "\logo.jpg"
  
      $attachment = New-Object System.Net.Mail.Attachment -ArgumentList $LogoFilePath
      $attachment.ContentDisposition.Inline = $True    
      $attachment.ContentDisposition.DispositionType = "Inline"
      $attachment.ContentType.MediaType = "image/jpg"
      $attachment.ContentId = "logo.jpg"
      $MailMessage.Attachments.Add($attachment)
  
      do {
          $Continue = $false
          try {
              $smtpclient.Send($MailMessage)
              Write-LogFile $OutputLogFile ("[SUCCESS] {0} {1}" -f $identity, $UMExtension)
              Write-LogFile $customemaillog ("[SUCCESS] {0} {1}" -f $identity, $UMExtension) | out-null
              $Continue = $true
          } catch {
              sleep -s 10
              Write-LogFile $OutputLogFile "[ERROR] $Identity $_.Exception.Message"
              Write-LogFile $CustomEmailLog "[ERROR] $Identity $UMExtension"
              Write-Error $_.Exception.Message
          }    
      } until($Continue -eq $true)
  }   # End send message
  
  $WelcomeText = Get-Content -Path ".\$CountryID.txt"
  $Body = @"
  &lt;html&gt;
  ...
  &lt;/html&gt;
  "@
  </code></pre>
  
  <p>The here string is part of the script, I'd like to be able to import it from TXT file as not to clutter the script.</p>