IsEmailServerAvailable method: MCFMailUtil class

Syntax

IsEmailServerAvailable(server, port, user, password)

Description

Use the IsEmailServerAvailable method to check if the email server specified with the SMTP settings in the application server configuration file is available.

This method returns true if successful. If the return value is false, the following MCFMailUtil properties are set accordingly:

  • ErrorDescription

  • ErrorDetails

  • ErrorMsgParamsCount

  • MessageNumber

  • MessageSetNumber

In addition you can use the GetErrorMsgParam method to return each of the substitution strings used to format the error message.

Parameters

Parameter Description

server

Specify the name of the mail server handling the specified user account, as a string.

port

Specify the port of the mail server handling the specified user account, as an integer.

user

Specify the user name on the mail server, such as “support” or “john_doe”, as a string.

password

Specify the password associated with the specified user name, as a string.

Returns

A Boolean value: true if the server is available, false otherwise.