![]() |
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.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.
load ./chilkat.dll set mailman [new_CkMailMan] # ... # ... set emailAddr "joe@example.com" # ------------------------------------------------------------------------ # The MxLookupAll method is deprecated: # sa is a CkStringArray set sa [CkMailMan_MxLookupAll $mailman $emailAddr] if {[CkMailMan_get_LastMethodSuccess $mailman] == 0} then { puts [CkMailMan_lastErrorText $mailman] delete_CkMailMan $mailman exit } # ... # ... delete_CkStringArray $sa # ------------------------------------------------------------------------ # 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.