troubleshooting Question

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

Avatar of E=mc2
E=mc2 asked on
PowershellScripting Languages
3 Comments1 Solution119 ViewsLast Modified:
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 = ""
$EncryptedPW = Get-Content $EncryptedCredential | ConvertTo-SecureString
$Credential = New-Object System.Management.Automation.PsCredential($EmailUsername, $EncryptedPW)
$EmailFrom = ""
$EmailTo = "<>"
$EmailSubject = "Info"
$EmailBody = ($Line -join "<br>")
$SMTPServer = ""
$SMTPPort = 000
$SMTPSsl = $true
$param = @{
    SmtpServer = $SMTPServer
    Port = $SMTPPort
    UseSsl = $SMTPSsl      
    Credential = $Credential          
    From = $EmailFrom    
    To = $EmailTo              
    Subject = $EmailSubject
    Body = $EmailBody
Send-MailMessage @param
Jeremy WeisingerSenior Network Consultant / Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros