![]() |
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.MxLookup to Dns.QueryProvides instructions for replacing deprecated MxLookup method calls with the Chilkat Dns class. Note: This example requires Chilkat v11.0.0 or greater.
LOCAL loMailman LOCAL lcEmailAddr LOCAL lcDomain LOCAL loDns LOCAL loJson LOCAL lnSuccess LOCAL i LOCAL lnCount_i * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.MailMan') loMailman = CreateObject('Chilkat.MailMan') * ... * ... lcEmailAddr = "joe@example.com" * ------------------------------------------------------------------------ * The MxLookup method is deprecated: lcDomain = loMailman.MxLookup(lcEmailAddr) IF (loMailman.LastMethodSuccess = 0) THEN ? loMailman.LastErrorText RELEASE loMailman CANCEL ENDIF * ------------------------------------------------------------------------ * 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.