![]() |
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
(Visual FoxPro) 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.
LOCAL loMailman LOCAL lcEmailAddr LOCAL loSa LOCAL loDns LOCAL loJson LOCAL lnSuccess LOCAL i LOCAL lnCount_i LOCAL lcDomain * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.MailMan') loMailman = CreateObject('Chilkat.MailMan') * ... * ... lcEmailAddr = "joe@example.com" * ------------------------------------------------------------------------ * The MxLookupAll method is deprecated: loSa = loMailman.MxLookupAll(lcEmailAddr) IF (loMailman.LastMethodSuccess = 0) THEN ? loMailman.LastErrorText RELEASE loMailman CANCEL ENDIF * ... * ... RELEASE loSa * ------------------------------------------------------------------------ * Do the equivalent using the Chilkat DNS class * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Dns') loDns = CreateObject('Chilkat.Dns') * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject') loJson = CreateObject('Chilkat.JsonObject') * This gets all MX domains for an email address. (Typically one domain.) * The preferred domain will be at index 0 (see below). lnSuccess = loDns.Query("MX",lcEmailAddr,loJson) IF (lnSuccess = 0) THEN ? loDns.LastErrorText RELEASE loMailman RELEASE loDns RELEASE loJson CANCEL ENDIF i = 0 lnCount_i = loJson.SizeOfArray("answer.mx") DO WHILE i < lnCount_i loJson.I = i lcDomain = loJson.StringOf("answer.mx[i].domain") ? lcDomain i = i + 1 ENDDO RELEASE loMailman RELEASE loDns RELEASE loJson |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.