#!/usr/bin/perl use MIME::QuotedPrint; use MIME::Base64; use Mail::Sendmail 0.75; %mail = ( SMTP => $SMTPSERVER, from => $SENDER, to => $RECP, subject => $Subject, ); $boundary = "====" . time() . "===="; $mail{'content-type'} = "multipart/mixed; boundary=\"$boundary\""; $message = encode_qp( "Text of message"); $file = 'message.txt'; # This is the file name $mail{body} = encode_base64( $message ); $boundary = '--'.$boundary; $mail{body} = <