in reply to Re: How to send mail (with attachments) from a Winx64 box
in thread How to send mail (with attachments) from a Winx64 box
use strict; use Net::DNS; my ($domain) = $email_to =~ /@(.*)$/; my ($mailserver) = map { $_->exchange } sort { $a->preference <=> $b-> +preference } mx($domain);
This gets the most preferred mailserver. Alternately, you might want to loop the array by preference, exiting on success.
|
|---|