in reply to How to determine smtp host on a domain

As blakem points out, you usually want to use a local SMTP server and let it worry about getting the mail to the correct place, but if you want to do this yourself you need to employ DNS; specifically looking up of MX records, which -- as luck would have it --Net::DNS's (alt.) mx method can help ...

use Net::DNS; my @mx = mx("perlmonk.org");

For more info, see RFC 2821: Simple Mail Transfer Protocol (specifically Section 5).

    --k.