title: powershell : using get-content as body of an smtp mail
body: <p>I am using powershell to send an SMTP mail. The body of the email is from a file.
  The problem is, when I receive this email, it removes all spaces and linefeeds so it looks ugly.</p>
  
  <p>Outlook client is no removing linebreaks.</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>$smtpserver = "smtpserver"
  $from="email1@domain.com"
  $to="email2@domain.com"
  $subject="something"
  $body= (Get-Content $OutputFile )
  $mailer = new-object Net.Mail.SMTPclient($smtpserver)
  $msg = new-object Net.Mail.MailMessage($from,$to,$subject,$body)
  $msg.IsBodyHTML = $true
  $mailer.send($msg)
  </code></pre>
  
  <p>I have even tried to use get-content with -encoding ASCII and couple of others but no help.
  Can anyone please help?</p>
  
  <p>-</p>
  
  <p>thanks</p>