📜  使用批处理文件脚本发送电子邮件 - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:38.141000             🧑  作者: Mango

代码示例2
Use batch script to call powershell Send-MailMessage

Batch Script:send_email.bat
        C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe  -command 'E:\path\send_email.ps1

Pwershell Script:send_email.ps1
        Send-MailMessage -From "noreply@$env:computername" -To '' -Subject 'Blah Blah' -SmtpServer  'smtp.domain.com'  -Attachments 'E:\path\file.log' -BODY "Blah Blah on Host: $env:computername "