E=mc2
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\N ew.txt"
#Send Email
$EncryptedCredential = "C:\secred\info.txt"
$EmailUsername = "mail@office365.com"
$EncryptedPW = Get-Content $EncryptedCredential | ConvertTo-SecureString
$Credential = New-Object System.Management.Automati on.PsCrede ntial($Ema ilUsername , $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
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\N
#Send Email
$EncryptedCredential = "C:\secred\info.txt"
$EmailUsername = "mail@office365.com"
$EncryptedPW = Get-Content $EncryptedCredential | ConvertTo-SecureString
$Credential = New-Object System.Management.Automati
$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
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Glad to help. :)
ASKER