How to create newline in HPC Pack 2019 Custom Email Notification Script

George Li 0 Reputation points
2023-05-29T10:30:05.07+00:00

I am trying to set up email notifications on my install of HPC Pack 2019. I can get the emails sent no problem. However the issue is in formatting.

Using the sample code from https://learn.microsoft.com/en-us/powershell/high-performance-computing/using-customized-email-notification?view=hpc19-ps, I can get the output however there is no new line. Instead, it is one long string. I have tried every combination of `` r, r ```n, \n, \\n, environment new lines, HTML and rich text. Tab endings. Tab beginnings. Triple Space Endings and beginnings. \t endings. etc. I can only ever get the email body to print as a single long line one I check it in my outlook inbox. I have checked both my desktop outlook and the web outlook.

I am at a loss and would appreciate any help at all.

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,047 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 33,951 Reputation points Microsoft Vendor
    2023-05-30T10:28:53.9566667+00:00

    Hi @George Li ,

    Please see if the HTML break tag <br /> adds a new line. This works when the mail body is sent as HTML.

    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.

    0 comments No comments