[APAC]自动发送邮件

$lastMon = ((get-date).AddDays(-7) -split(" "))[0] 
$lastFri = ((get-date).AddDays(-3) -split(" "))[0] 
$emsno = Read-Host -Prompt "plz input EMS No." 
$tcssmtpserver = "172.17.8.52" #"smtp.tcs.com" 
$sender = "[email protected]" 
$to = "[email protected]" 
$cc = "[email protected]" 
$subject = "Pls Send backup media from Hangzhou to Shanghai" 
$body = "Dear Lisa, 

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

The EMS NO. is: $emsno. 

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

 

你可能感兴趣的:(发送邮件)