powershell V2 发邮件

29 Nov

powershell v1的时候,咱要发个邮件还挺麻烦的。升级到V2后,新脚本send-mailmessgae简化了这个步骤。

别以为exchange 2007没法使用V2哦!exchange 2007支持powershell v2的,只是新功能,比如远程连接这些无法使用而已。Powershell V2的原生命令都是支持的。

Send-MailMessage –From –To –Subject “Test Email” –Body “Testing the cmdlet” –SmtpServer


send-mailmessage -from "User02 <>" -to "User01 <>" -subject "Test mail"

send-mailmessage -from "User01 <>" -to "User02 <>", "User03 <>" -subject "Sending the Attachment" -body "Forgot to send the attachment. Sending now." -Attachments "data.csv" -priority High -dno onSuccess, onFailure -smtpServer

send-mailmessage -from "ITGroup <>"-to "User01 <>" -cc "User02 <>" -bcc "ITMgr <>" -subject "Don’t forget today’s meeting!" -credential domain01\admin01 -useSSL



1 Comment

Posted by on November 29, 2009 in Powershell


One response to “powershell V2 发邮件

  1. zheng

    April 29, 2010 at 11:48



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: