Link to home
Create AccountLog in
Avatar of E=mc2
E=mc2Flag 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
ASKER CERTIFIED SOLUTION
Avatar of Jeremy Weisinger
Jeremy Weisinger

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of E=mc2

ASKER

Thanks so much I will test it and let you know.. many thanks for trying, much appreciated.
Avatar of Jeremy Weisinger
Jeremy Weisinger

Glad to help. :)