Hi All,
I'm new at Powershell and having some difficulty with this script below. I cant seem to find a way to run this script without storing the password in the script for my account. I do not want to use the Powershell email cmdlet.
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)
$Body1 = (get-content C:\users\Failure.htm)
$SMTPClient.EnableSsl = $true
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential("username,"Password" );
$message = New-Object Net.Mail.MailMessage($EmailFrom, $EmailTo, $Subject, $Body1)
$message.IsBodyHtml = $true;