IsDomainNameValid method: MCFMailUtil class

Syntax

IsDomainNameValid(domainname)

Description

Use this method to check whether a domain name is valid. The isDomainNameValid method queries your DNS server to check whether the domain name is listed in an "MX", or mailbox exchange, record. Please note that not all domains are properly listed by DNS servers.

Note:

The number of retries for domain validation is set by the SMTPDNSTimeoutRetries parameter in psappsrv.cfg. The default number of retries is 1.

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

domainname

Specifies the domain name to be validated, as a string.

Returns

A Boolean value: true if the domain name is valid, false otherwise.

Example

Local PT_MCF_MAIL:MCFMailUtil &emailutil = create PT_MCF_MAIL:MCFMailUtil();
&result = &emailutil.IsDomainNameValid("oracle.com");