你可以使用Send-MailMessage發(fā)送郵件,但是你想從你默認(rèn)MAPI客戶端準(zhǔn)備發(fā)送一份郵件,這也不是很麻煩:
$body = 'My Message'
$to = 'tobias@powertheshell.com'
$mail = "mailto:$to&subject=$subject&body=$body"
Start-Process -FilePath $mail
這個(gè)腳本的優(yōu)勢(shì)就是向用戶發(fā)送郵件。只要你安裝了MAPI客戶端,它將自動(dòng)打開郵件并填充腳本指定信息。但你必須手動(dòng)發(fā)送這份郵件。
文章出處:http://www.pstips.net/sending-email-via-outlook.html