I am working on changing Send-MailMessage formatting based on error or success. When there is an error, I would like to have the Subject and email Body text appear in red color. On success, I would like to change the Subject and email body text to Blue color. I was able to change the success email body to Blue color but the Subject and error email body does not work as expected.
PoSh Code:
$Emailsubject = "<p style=""color:red;"">Error occured</p><br><br>"
$ErrorMessage = "<p style=""color:red;"">" New-Object System.Exception ("Error: " + $error[0].Exception.InnerException.ToString())"</p><br><br>"
