lee*_*d00 3 email parameters powershell
这是我使用的Powershell版本:
$ PSVersionTable.PSVersion产生:
Major Minor Build Revision
----- ----- ----- --------
2 0 -1 -1
Run Code Online (Sandbox Code Playgroud)
这是命令:
Send-MailMessage -To "someadmin@somedomain.com" -Body "This is just a test" -Subject "Test" -UseSsl
-Port 587 -SmtpServer 'smtp.office365.com' -From 'someadmin@somedomain.com' -Credential $creds
Run Code Online (Sandbox Code Playgroud)
这是错误:
Send-MailMessage : A parameter cannot be found that matches parameter name 'Port'.
At line:1 char:105
+ Send-MailMessage -To "someadmin@somedomain.com" -Body "This is just a test" -Subject "Test" -UseSsl -Port <<<< 587 -S
mtpServer 'smtp.office365.com' -From 'someadmin@somedomain.com' -Credential $creds
+ CategoryInfo : InvalidArgument: (:) [Send-MailMessage], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.SendMailMessage
Run Code Online (Sandbox Code Playgroud)
Port
在那个版本的Powershell中是否有争论?我需要升级powershell才能使用它吗?
归档时间: |
|
查看次数: |
7385 次 |
最近记录: |