title: Email body format and modification
body: <p>I am using below code in Powershell to get Email in proper table format from a plain text file <strong>output.txt</strong>:</p>
  
  <p><strong>code.ps1</strong></p>
  
  <pre><code>$smtpServer = "sunny@domain.com"
  $smtpFrom = "process@abc.com"
  $smtpTo = "sunny@abc.com"
  $messageSubject = "Data"
  
  $message = New-Object System.Net.Mail.MailMessage $smtpfrom, $smtpto
  $message.Subject = $messageSubject
  $message.IsBodyHTML = $true
  
  $body = Get-Content C:\output.txt | Out-String
  $body = $body -replace '^(\S+)\s+(\S+)\s+(\S+)', '&lt;tr&gt;&lt;th style = "border: 1px solid black; background: #dddddd; padding: 5px;"&gt;$1&lt;/th&gt;&lt;th style = "border: 1px solid black;   background: #dddddd; padding: 5px;"&gt;$2&lt;/th&gt;&lt;th style = "border: 1px solid black; background: #dddddd; padding: 5px;"&gt;$3&lt;/th&gt;&lt;/tr&gt;'
  $body = $body -replace '\n(\S+)\s+(\S+)\s+(\S+)', '&lt;tr&gt;&lt;td style = "border: 1px solid black; padding: 5px;"&gt;$1&lt;/td&gt;&lt;td style = "border: 1px solid black; padding: 5px;"&gt;$2&lt;/td&gt;&lt;td style = "border: 1px solid black; padding: 5px;"&gt;$3&lt;/td&gt;&lt;/tr&gt;'
  $body = '&lt;body&gt;&lt;table style = "border: 1px solid black; border-collapse: collapse;"&gt;' + $body + '&lt;/table&gt;&lt;/body&gt;'
  $message.Body = $body
  
  $smtp = New-Object Net.Mail.SmtpClient($smtpServer)
  $smtp.Send($message)
  </code></pre>
  
  <p>I want to do following changes in receiving Email structure:</p>
  
  <p><strong>Change1:</strong></p>
  
  <p>Email is coming in below format in table:</p>
  
  <pre><code>OPERATINGSYSTEM           PROJECTSERVER1   PROJECTSERVER2
  Windows                   1.36             4.42
  Linux12                   2.78             5.76
  MacOS                     3.45             6.39
  Ubuntu                    4.12             0.00
  Android                   0.00             3.46
  FreePhysicalMemory        30.12            31.65
  TotalVisibleMemorySize    48.00            48.00
  CPULoadPercentage         2                4
  </code></pre>
  
  <p>but, how can i align the values for 2nd and 3rd columns only in center like below?</p>
  
  <pre><code>OPERATINGSYSTEM           PROJECTSERVER1   PROJECTSERVER2
  Windows                       1.36             4.42
  Linux12                       2.78             5.76
  MacOS                         3.45             6.39
  Ubuntu                        4.12             0.00
  Android                       0.00             3.46
  FreePhysicalMemory           30.12            31.65
  TotalVisibleMemorySize       48.00            48.00
  CPULoadPercentage              2                4
  </code></pre>
  
  <p><strong>Change2:</strong></p>
  
  <p>How i can add below notes at end, outside of table in email body:</p>
  
  <pre><code>All memory values are in GB.
  
  Note: This is an automatically generated email, please don't reply to it.
  </code></pre>
  
  <p><strong>Change3:</strong></p>
  
  <p>How i can send this Email to multiple recipients with multiple CC's. Can i add email ids separated by commas like <strong>$smtpTo = "administrator@abc.com,dbadmin@abc.com..."</strong> ..?</p>