Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking With Open Transport / Part 2 - Open Transport Reference
Chapter 29 - TCP/IP Services Reference / Functions
Getting Information About an Internet Host /


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,
                                         Ine
C++ INTERFACE
OSStatus TInternetServices::MailExchange (char *name,
                                         UInt16 *num,
                                         InetMailExchange e 
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 mx parameter. When the function completes, it sets the number pointed to by the num parameter to the actual number of elements filled in.
mx
A pointer to the first element in an array of InetMailExchange structures. You must allocate the structures in this array.
function result
A result code. See Appendix B for more information.
DISCUSSION
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 mail gateway. 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 OTInetMailExchange function 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.

If you call this function asynchronously, the TCP/IP service provider calls your notifier function with the T_DNRMAILEXCHANGECOMPLETE completion event code when the function completes. The cookie parameter to the notifier function contains the array pointer you specified in the mx parameter. If you had more than one simultaneous outstanding call to the OTInetMailExchange function, you can use this information to determine which call has completed execution.

SPECIAL CONSIDERATIONS
If you call this function asynchronously, do not modify the InetMailExchange array until the function completes.

SEE ALSO
The InetMailExchange structure.

Internet mail routing and mail-exchange resource records are described in RFC 974: Mail Routing and the Domain System.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998