PowerShell 具有预定义参数的Send-MailMessage
示例
$parameters = @{
From = 'from@bar.com'
To = 'to@bar.com'
Subject = 'Email Subject'
Attachments = @('C:\files\samplefile1.txt','C:\files\samplefile2.txt')
BCC = 'bcc@bar.com'
Body = 'Email body'
BodyAsHTML = $False
CC = 'cc@bar.com'
Credential = Get-Credential
DeliveryNotificationOption = 'onSuccess'
Encoding = 'UTF8'
Port = '25'
Priority = 'High'
SmtpServer = 'smtp.com'
UseSSL = $True
}
# Notice: Splatting requires @ instead of $ in front of variable name
Send-MailMessage @parameters
热门推荐
10 冬至祝福语简短精悍幽默
11 毕业祝福语再见朋友简短
12 老板祝福语简短20字
13 精简短句生日祝福语
14 企业新春祝福语简短大全
15 最佳元旦祝福语简短学校
16 孩子过生日简短祝福语
17 要庆祝生日祝福语简短
18 婚庆开业祝福语大全简短