I want to Pass the content of txt file to body of Send-MailMessage in powershell I tried using the out-sting function and also use FT combination but its giving output in single line over email body I have to print the list of users one below other same as in text file but its getting printer in one line on email body
$path = "H:\userlist.txt"
$groups = Get-Content $path
$groups1 = $groups|format-table|out-string
Send-MailMessage -From "xyz@abg.com" -To test@abc.com -Subject test -BodyAsHtml -Body "User list below $groups1" -SmtpServer smtpgate.net