[APAC]自动发送邮件

$lastMon = ((get-date).AddDays(-7) -split(" "))[0] 
$lastFri = ((get-date).AddDays(-3) -split(" "))[0] 
$emsno = Read-Host -Prompt "plz input EMS No." 
$smtpserver = "172.17.8.52"
$sender = "chen.chen@abc.com" 
$to = "simin.z@abc.com" 
$cc = "chen.chen@abc.com" 
$subject = "Pls Send backup media from Hangzhou to Shanghai" 
$body = "Dear Lisa, 

Please send weekly backup tape ($lastMon -> $lastFri) to Shanghai  office today by EMS couri 

The EMS NO. is: $emsno. 

yours, 
" 
Send-MailMessage -SmtpServer $smtpserver -From $sender -To $to -Cc $cc -Subject $subject -Body $body

 

posted @ 2015-05-13 16:15  dongdonggeorge  阅读(187)  评论(0编辑  收藏  举报