Send mail from a Windows script

前端 未结 7 960
耶瑟儿~
耶瑟儿~ 2021-01-02 07:11

I would like to send mail from a script on a Windows Server 2003 Standard Edition. I think the server setup is pretty much out of the box.

The mail server is an Exch

7条回答
  •  醉话见心
    2021-01-02 08:11

    If the server happened (I realize how old this question is) to have Powershell v2 installed, the CmdLet Send-MailMessage would do this in one line.

    Send-MailMessage [-To]  [-Subject]  -From  [[-Body] ] [[-SmtpServer] ] [-Attachments ] [-Bcc ] [-BodyAsHtml] [-Cc ] [-Credential ] [-DeliveryNotficationOption {None | OnSuccess | OnFailure | Delay | Never}] [-Encoding ] [-Priority {Normal | Low | High}] [-UseSsl] []
    

提交回复
热议问题