Avatar of E=mc2
Flag for Canada

asked on 

How can I modify this script so that the output does not have the br symbol?

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
PowershellScripting Languages

Avatar of undefined
Last Comment
Jeremy Weisinger

8/22/2022 - Mon