OTInetMailExchange
Returns mail-exchange-host names and preference information for a domain name you specify.C INTERFACE
OSStatus OTInetMailExchange (InetSvcRef ref, char *name, UInt16 *num, InetMailExchange *mx);C++ INTERFACE
OSStatus TInternetServices::MailExchange (char *name, UInt16 *num, InetMailExchange *mx);PARAMETERS
ref- The internet services reference you obtained when you opened the TCP/IP service provider.
name- A pointer to a host name, partially qualified domain name, or fully qualified domain name for which you want mail exchange information.
num- A pointer to the number of elements in the array pointed to by the
mxparameter. When the function completes, it sets the number pointed to by thenumparameter to the actual number of elements filled in.mx- A pointer to the first element in an array of
InetMailExchangestructures. You must allocate the structures in this array.DESCRIPTION
In order to deliver mail, a mail application must determine the fully qualified domain name of the host to which the mail should be sent. That host might be the final destination of the mail, a mail server, or a router. The domain name system servers maintain mail-exchange resource records that pair domain names with the hosts that can accept mail for that domain. Each domain name can be paired with any number of host names; each record containing such a pair also contains a preference number. The mailer sends the mail to the host with the lowest preference number first and tries the others in turn until the mail is delivered or until the mailer decides that the mail is undeliverable.The
OTInetMailExchangefunction returns mail-exchange-host and preference information for the domain name you specify. You must then determine the address of the host and how best to deliver the mail. You can specify as many elements to the array ofInetMailExchangestructures as you wish.If you call this function asynchronously, the TCP/IP service provider calls your notifier function with the
T_DNRMAILEXCHANGECOMPLETEcompletion event code when the function completes. Thecookieparameter to the notifier function contains the array pointer you specified in themxparameter. If you had more than one simultaneous outstanding call to theOTInetMailExchangefunction, you can use this information to determine which call has completed execution.SPECIAL CONSIDERATIONS
If you call this function asynchronously, do not write to theInetMailExchangearray until the function completes.COMPLETION EVENT CODES
T_DNRMAILEXCHANGECOMPLETE0x10000004 The OTInetMailExchangefunction has completed.SEE ALSO
TheInetMailExchangestructure is described in "Internet Mail Exchange Structure" on page 8-28.Internet mail routing and mail-exchange resource records are described in Request for Comments 974: Mail Routing and the Domain System.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help