SMTP - Mail routing When a client sends a message, it connects to a pre-configured mail server, unless it was configured to send email directly to the target address. The local mail server looks up the name of the host in the target address, using the DNS system. If an MX record for that address is found, that's the mail server to which connection will be established. if there are several MX records, they will be tried in order of priority. If there is no MX record but there is an A record, the local mail server will try to connect to that machine (or any of a set of such machines).