![]() |
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
(Lianja) 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.
loMailman = createobject("CkMailMan") // ... // ... lcEmailAddr = "joe@example.com" // ------------------------------------------------------------------------ // The MxLookup method is deprecated: lcDomain = loMailman.MxLookup(lcEmailAddr) if (loMailman.LastMethodSuccess = .F.) then ? loMailman.LastErrorText release loMailman return endif // ------------------------------------------------------------------------ // Do the equivalent using the Chilkat DNS class loDns = createobject("CkDns") loJson = createobject("CkJsonObject") // This gets all MX domains for an email address. (Typically one domain.) // The preferred domain will be at index 0 (see below). llSuccess = loDns.Query("MX",lcEmailAddr,loJson) if (llSuccess = .F.) then ? loDns.LastErrorText release loMailman release loDns release loJson return 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.