Hi,
You can add the <br> tags to insert line breaks since you use the "-BodyAsHtml" parameter.
$path = "H:\userlist.txt"
$groups = (Get-Content $path) -join '<br>'
Send-MailMessage -From "xyz@abg.com" -To test@abc.com -Subject test -BodyAsHtml -Body "User list below $groups1" -SmtpServer smtpgate.net
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.