Power Shell - SendEmail function
Posted on 2013-05-16
I am running another PS script (not listed here) and the output of that script I need to email to myself. Below is what I would like to use but can not figure out which fields need to be entered with my organisations details. Can someone please mark what and where I need to put my company's details below so this will work.
$body = Get-Content $htmlFileName
$smtp= New-Object System.Net.Mail.SmtpClient $smtphost
$msg = New-Object System.Net.Mail.MailMessage $from, $to, $subject, $body
$msg.isBodyhtml = $true
sendEmail User@Domain.com User@DOMAIN.com "Database Report" server1 $fileName