![]() |
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
(Tcl) 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.
load ./chilkat.dll set mailman [new_CkMailMan] # ... # ... set emailAddr "joe@example.com" # ------------------------------------------------------------------------ # The MxLookup method is deprecated: set domain [CkMailMan_mxLookup $mailman $emailAddr] if {[CkMailMan_get_LastMethodSuccess $mailman] == 0} then { puts [CkMailMan_lastErrorText $mailman] delete_CkMailMan $mailman exit } # ------------------------------------------------------------------------ # Do the equivalent using the Chilkat DNS class set dns [new_CkDns] set json [new_CkJsonObject] # This gets all MX domains for an email address. (Typically one domain.) # The preferred domain will be at index 0 (see below). set success [CkDns_Query $dns "MX" $emailAddr $json] if {$success == 0} then { puts [CkDns_lastErrorText $dns] delete_CkMailMan $mailman delete_CkDns $dns delete_CkJsonObject $json exit } set i 0 set count_i [CkJsonObject_SizeOfArray $json "answer.mx"] while {$i < $count_i} { CkJsonObject_put_I $json $i set domain [CkJsonObject_stringOf $json "answer.mx[i].domain"] puts "$domain" set i [expr $i + 1] } delete_CkMailMan $mailman delete_CkDns $dns delete_CkJsonObject $json |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.