(PowerBuilder) MX Lookup Mail Server Domain by Email Address
How to find the mail server for a given email address. Returns the domain name of the primary mail server.
integer li_rc
oleobject loo_Mailman
string ls_MxDomain
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Mailman = create oleobject
// Use "Chilkat_9_5_0.MailMan" for versions of Chilkat < 10.0.0
li_rc = loo_Mailman.ConnectToNewObject("Chilkat.MailMan")
if li_rc < 0 then
destroy loo_Mailman
MessageBox("Error","Connecting to COM object failed")
return
end if
ls_MxDomain = loo_Mailman.MxLookup("support@chilkatsoft.com")
if loo_Mailman.LastMethodSuccess <> 1 then
Write-Debug loo_Mailman.LastErrorText
destroy loo_Mailman
return
end if
Write-Debug "MX Domain: " + ls_MxDomain
destroy loo_Mailman
|