in reply to Re: help with scp error codes
in thread help with scp error codes

MIME::Lite is a fine (and more reliable) option, but seeing we are just shelling out to scp why not just invoke sendmail directly by opening a pipe and sending it the required data:

my $sendmail = "/usr/sbin/sendmail -t"; open MAIL, "|$sendmail" or die "Cannot open $sendmail: $!"; print MAIL <<EMAIL; Reply-to: $reply_to Subject: $subject To: $send_to Content-type: text/plain $content . EMAIL close MAIL;