OpsaC - Operating as PowerShell code
published: October 5, 2015 author: Tinu tags: Email categories: PowerShell
#region SendMail
$MailServer = "mailrelay.company.ch"
$MailFrom = "postmaster@company.ch"
$MailTo = "support@company.ch"
$Subject = "Testmessage"
$Body = "Hello Support`n`n"
$Body += "This is a test message for you.`n`n"
$Body += "Kind regards`n`n"
$Body += "Postmaster"
$FullFileName = "C:\Company\Output\Report.htm"
Send-MailMessage -From $MailFrom -To $MailTo -Subject $Subject `
-Body $Body -SmtpServer $MailServer -Attachments $FullFileName
#endregion