title: Send mail body with Robocopy Summary in powershell
body: <p>I am using powershell to send mail with Robocopy Summary from sheduled task. </p>
  
  <p>Below is the powershell version details </p>
  
  <pre><code>Name                           Value
  ----                           -----
  PSVersion                      5.1.15063.502
  PSEdition                      Desktop
  PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
  BuildVersion                   10.0.15063.502
  CLRVersion                     4.0.30319.42000
  WSManStackVersion              3.0
  PSRemotingProtocolVersion      2.3
  SerializationVersion           1.1.0.1
  </code></pre>
  
  <p>My script is below, </p>
  
  <pre><code>$pw = Get-Content .\bumblebee.txt | ConvertTo-SecureString 
  $cred = New-Object System.Management.Automation.PSCredential "xyz\abc", $pw
  $cont = gc C:\Users\Vinod_DMSE\Desktop\Bat\backup_log_20170816.log -last 12 |%{"$_ &lt;br/&gt;"}|out-String
  $encoding = [System.Text.Encoding]::UTF8 
  Send-MailMessage -SmtpServer smtp.xyz.com -to "abc@xyc.com" -Credential $cred -from "backupkr.alert@xyz.com" -Subject " Backup Alert" -BodyAsHtml $cont"
  </code></pre>
  
  <p>This works,</p>
  
  <p>But when I'm getting the mail body with text alignment issues. </p>
  
  <p>Below is the output </p>
  
  <p><a href="https://i.stack.imgur.com/DQs9K.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DQs9K.jpg" alt="enter image description here"></a>  </p>
  
  <p>Is it possible to get output as in powershell with more aligned. </p>
  
  <p><a href="https://i.stack.imgur.com/zA4rE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zA4rE.jpg" alt="enter image description here"></a></p>
  
  <p>Thanks in advance, </p>