![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(VB.NET) Transition from MailMan.MxLookupAll to the Chilkat DNS classProvides instructions for replacing deprecated MxLookupAll method calls with the Chilkat Dns class. Note: This example requires Chilkat v11.0.0 or greater.
Dim mailman As New Chilkat.MailMan ' ... ' ... Dim emailAddr As String = "joe@example.com" ' ------------------------------------------------------------------------ ' The MxLookupAll method is deprecated: Dim sa As Chilkat.StringArray = mailman.MxLookupAll(emailAddr) If (mailman.LastMethodSuccess = False) Then Debug.WriteLine(mailman.LastErrorText) Exit Sub End If ' ... ' ... ' ------------------------------------------------------------------------ ' Do the equivalent using the Chilkat DNS class Dim dns As New Chilkat.Dns Dim json As New Chilkat.JsonObject ' This gets all MX domains for an email address. (Typically one domain.) ' The preferred domain will be at index 0 (see below). Dim success As Boolean = dns.Query("MX",emailAddr,json) If (success = False) Then Debug.WriteLine(dns.LastErrorText) Exit Sub End If Dim i As Integer = 0 Dim count_i As Integer = json.SizeOfArray("answer.mx") While i < count_i json.I = i Dim domain As String = json.StringOf("answer.mx[i].domain") Debug.WriteLine(domain) i = i + 1 End While |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.