Tinus EngOps Wiki

Logo

OpsaC - Operating as PowerShell code

Links

Home

IT-Wiki

PowerShell Blog

PowerShell Index

PowerShell Search

Additional Websites

View my GitHub Profile

View my GitHub Gists

View my Codeberg Page

View my Photo Website

E-Mail versenden

published: October 5, 2015 author: Tinu tags: Email categories: PowerShell


E-Mail per PowerShell versenden

#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

← Previous Post ◇ [ Top ] ◇ Copyright © 2024 by tinuwalther ◇ [ Blog ] ◇ Next Post →