The TestSmtpConnection Windows Management Instrumentation (WMI) class method, in System Center 2012 R2 Configuration Manager, tests the SMTP connection.

The following syntax is simplified from Managed Object Format (MOF) code and defines the method.

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

Parameters

ServerFqdn

Data type: String Qualifiers: [in]The FQDN of the SMTP server.
Port

Data type: UInt32 Qualifiers: [in]The port for the SMTP server.
Sender

Data type: String Qualifiers: [in]Email address of the sender.
Recipients

Data type: String Qualifiers: [in]Email addresses of the recipients.
AuthenticationType

Data type: UInt32 Qualifiers: [in]Authentication type. Possible values are:

0

Anonymous access.

1

Use the computer account of the site server.

2

Use the specified user name and password.

UserName

Data type: String Qualifiers: [in]User name of the SMTP server connection account. This is used when AuthenticationType is 2.
EncryptPassword

Data type: String Qualifiers: [in]The encrypted password for the SMTP server connection account. This is used when AuthenticationType is 2.
TestID

Data type: UInt32 Qualifiers: [out]Test identifier. Used by GetTestSmtpConnectionResult to the test result.

Return Values

An SInt32 data type that is 0 to indicate success or non-zero to indicate failure.

For more information about handling returned errors, see About Configuration Manager Errors.

Requirements

Runtime Requirements

Development Requirements

See Also