
Powershell script to email
###########Define Variables########
$date = “get-date”
$fromaddress = “[email protected]”
$toaddress = “[email protected]”
$Subject = “Test $(get-date)”
$body = Get-Content C:\temp\Test.htm
#$attachment = “C:\sendemail\test.txt”
$smtpserver = “SMTP Server name”
####################################
$message = new-object System.Net.Mail.MailMessage
$message.From = $fromaddress
$message.To.Add($toaddress)
#$message.CC.Add($CCaddress)
#$message.Bcc.Add($bccaddress)
$message.IsBodyHtml = $True
$message.Subject = $Subject
#$attach = new-object Net.Mail.Attachment($attachment)
#$message.Attachments.Add($attach)
$message.body = $body
$smtp = new-object Net.Mail.SmtpClient($smtpserver)
$smtp.Send($message)
yvlzte
Wonderful website. Lots of helpful info here. I¦m sending it to several pals ans additionally sharing in delicious. And of course, thanks for your sweat!
hello!,I like your writing very much! share we communicate more about your post on AOL? I require a specialist on this area to solve my problem. Maybe that’s you! Looking forward to see you.
Este site é realmente fascinate. Sempre que consigo acessar eu encontro coisas boas Você também pode acessar o nosso site e descobrir mais detalhes! informaçõesexclusivas. Venha descobrir mais agora! 🙂
8kmttp
kc8nxo
g73mzi
kw4bum
u9ncg1
kj6zyd
Thanks so much for providing individuals with an exceptionally superb opportunity to read in detail from this site. It can be very excellent plus jam-packed with fun for me and my office acquaintances to visit your web site at the least three times per week to read the new tips you will have. And lastly, I am also usually motivated for the spectacular tips you give. Certain 3 ideas in this posting are basically the very best I have had.