类SMS_Subscription中的 TestSmtpConnection 方法

Configuration ManagerTestSmtpConnection中,Windows Management Instrumentation (WMI) 类方法测试 SMTP 连接。

以下语法从托管对象格式 (MOF) 代码中简化,并定义了 方法。

语法

sint32 TestSmtpConnection(  
     String ServerFqdn,  
     UInt32 Port,  
     String Sender,  
     String Recipients,  
     UInt32 AuthenticationType,  
     String UserName,  
     String EncryptPassword,   
     UInt32 TestID  
);  

参数

ServerFqdn
数据类型String

限定 符: [in]

SMTP 服务器的 FQDN。

Port
数据类型UInt32

限定 符: [in]

SMTP 服务器的端口。

Sender
数据类型String

限定 符: [in]

发件人Email地址。

Recipients
数据类型String

限定 符: [in]

Email收件人的地址。

AuthenticationType
数据类型UInt32

限定 符: [in]

身份验证类型。 可能的值是:

身份验证类型
0 匿名访问。
1 使用站点服务器的计算机帐户。
2 使用指定的用户名和密码。

UserName
数据类型String

限定 符: [in]

SMTP 服务器连接帐户的用户名。 当 为 2 时 AuthenticationType ,将使用此值。

EncryptPassword
数据类型String

限定 符: [in]

SMTP 服务器连接帐户的加密密码。 当 为 2 时 AuthenticationType ,将使用此值。

TestID
数据类型UInt32

限定 符: [out]

测试标识符。 GetTestSmtpConnectionResult用于测试结果。

返回值

一个 SInt32 数据类型,为 0 表示成功,非零表示失败。

有关处理返回的错误的详细信息,请参阅关于Configuration Manager错误

要求

运行时要求

有关详细信息,请参阅Configuration Manager服务器运行时要求

开发要求

有关详细信息,请参阅Configuration Manager服务器开发要求

另请参阅

SMS_Subscription服务器 WMI 类
SMS_Subscription服务器 WMI 类