$emailFrom = "abc@mail.com"
$emailTo = "abc@mail.com"
$smtpUser = "abc@mail.com"
$smtpPassword = "passwd"
$subject = "Mail Test"
$body="mail body"
$body = $body+$message
$smtpServer = "smtp-Server.com"
#$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$smtp = New-Object System.Net.Mail.SmtpClient -argumentList $smtpServer
$smtp.Credentials = New-Object System.Net.NetworkCredential -argumentList $smtpUser,$smtpPassword
$smtp.Send($emailFrom, $emailTo, $subject, $body)
本文介绍了一段使用PowerShell编写的邮件发送自动化脚本,包括SMTP服务器配置、邮件主题和内容设置。
178

被折叠的 条评论
为什么被折叠?



