http://www.perlmonks.org?node_id=177141


in reply to Re: How do I rewrite mail headers using Mail::Send?
in thread How do I rewrite mail headers using Mail::Send?

Mail::Mailer allows you to set the type of mail server you are using. It checks mailx, Mail and mail in that order if you do not specify the $type. So, in other words to change this default behavior from mailx Mail and mail to smtp a snippet might look like:
use Mail::Mailer; use Mail::Mailer qw(mail); $mailer = new Mail::Mailer; $mailer = new Mail::Mailer 'smtp', Server => $server; $mailer->open(\%headers); print $mailer $body; $mailer->close;