use MIME::QuotedPrint; use MIME::Base64; use Mail::Sendmail 0.75; # doesn't work with v. 0.74! %mail = ( from => 'you@domain.tld', to => 'whoever@someplace.tld', subject => 'Test attachment', ); $boundary = "====" . time() . "===="; $mail{'content-type'} = "multipart/mixed; boundary=\"$boundary\""; $message = encode_qp( "Some message" ); $file = $^X; # This is the perl executable open (F, $file) or die "Cannot read $file: $!"; binmode F; undef $/; $mail{body} = encode_base64(); close F; $boundary = '--'.$boundary; $mail{body} = <