I want to modify this script, since the output in the body of the email is actually showing
the <br> and is not producing the ouput on separate lines when it sees the <br>.. but keeps everything together.
Thanks for your help.
$Line = Get-Content "C:\Programs\ABC\ABCTemp\New.txt"
#Send Email
$EncryptedCredential = "C:\secred\info.txt"
$EmailUsername = "mail@office365.com"
$EncryptedPW = Get-Content $EncryptedCredential | ConvertTo-SecureString
$Credential = New-Object System.Management.Automation.PsCredential($EmailUsername, $EncryptedPW)
$EmailFrom = "mail@office365.com"
$EmailTo = "<mail2@office365.com>"
$EmailSubject = "Info"
$EmailBody = ($Line -join "<br>")
$SMTPServer = "xxx.xxxx.com"
$SMTPPort = 000
$SMTPSsl = $true
$param = @{
SmtpServer = $SMTPServer
Port = $SMTPPort
UseSsl = $SMTPSsl
Credential = $Credential
From = $EmailFrom
To = $EmailTo
Subject = $EmailSubject
Body = $EmailBody
}
Send-MailMessage @param