title: Attaching to an email in powershell script
body: <p>I have the following powershell script:</p>
  
  <pre><code>$csv = Import-Csv -Path D:\temp\Audit.csv | Where-Object {$_.PrivateLabelSeqId -eq "602"} | Measure-Object
  $Fun = $csv.Count
  $mailBody = 
  @"
  There are &lt;b&gt; $Fun &lt;/b&gt; available!
  "@
  
  Send-MailMessage -Body $mailBody -BodyAsHtml `
  -From "mail@mail.com" -To "mailto@mail.com" `
  -Subject "Audit - FUN" -Encoding $([System.Text.Encoding]::UTF8) `
  -Attachment "D:\temp\Audit.csv" `
  -SmtpServer "192.0.0.20"
  </code></pre>
  
  <p>Yet I do not get any email sent out. Without the attachment however, it seems to work just fine. Any ideas on how to resolve this? 
  Thanks</p>