Return the number of mail exchange records for the specified host.
An integer value. A value of zero specifies that there are no mail exchange records for the host.
The MailExchanges property returns the number of mail exchange (MX) records for the current host specified by the HostName property. This property can be used in conjunction with the MailExchange array to enumerate the servers responsible for accepting mail for a given domain.
The following example populates a ListBox control with the host names of those servers responsible for accepting e-mail for the specified domain:
[Visual Basic]
Dim nIndex As Integer
ListBox1.Items.Clear()
dnsClient.HostName = strHostName
For nIndex = 0 To dnsClient.MailExchanges - 1
ListBox1.Items.Add(dnsClient.MailExchange(nIndex))
Next
DnsClient Class | SocketTools Namespace | MailExchange Field