Powershell Send mail by SMTP

#Powershell send mail by SMTP# 從網路上找到趕快把他記下來 如何使用 PowerShell send email ``` $daily = Get-Date -Format "yyyy/MM/dd" $From = "TestSender@test.com" $To = "test@test.com" $Cc = "AThirdUser@somewhere.com" $Attachment = "C:\users\Username\Documents\SomeTextFile.txt" $Subject = "Subject" $Body = "Please check attach files, file will remove $daily" $SMTPServer = "smtp server address" #$SMTPPort = "587" Send-MailMessage -From $From -To $To -Subject $Subject -Body $Body -SmtpServer $SMTPServer -Attachments ```

留言

這個網誌中的熱門文章

Easy Triangle Calculator

Powershell transfert UPS Worldship address book to csv file for UPS web import

Swift Sprite Kit easy to create bullet