You'll need to look up the MX record for the host. Net::DNS will do the trick. I'm not 100% sure why you'd want to though, it's much easier setting up a mail server (postfix for example) and relaying through it.
gav^
Comment on Re: How to determine smtp host on a domain