rlm@37: use MIME::QuotedPrint; rlm@37: use MIME::Base64; rlm@37: use Mail::Sendmail 0.75; # doesn't work with v. 0.74! rlm@37: rlm@37: %mail = ( rlm@37: from => 'rlm@mit.edu', rlm@37: to => 'rlm@mit.edu', rlm@37: subject => 'Test attachment', rlm@37: ); rlm@37: rlm@37: rlm@37: $boundary = "====" . time() . "===="; rlm@37: $mail{'content-type'} = "multipart/mixed; boundary=\"$boundary\""; rlm@37: rlm@37: $message = encode_qp( "email from your friend PERL." ); rlm@37: rlm@37: $file = "./inkscape/arrow.svg"; rlm@37: rlm@37: open (F, $file) or die "Cannot read $file: $!"; rlm@37: binmode F; undef $/; rlm@37: $attach1 = encode_base64(); rlm@37: close F; rlm@37: rlm@37: rlm@37: rlm@37: $attach2 = encode_base64("hi this is a test arttacghjkalsdlasndlashdlsf"); rlm@37: rlm@37: rlm@37: rlm@37: rlm@37: rlm@37: $boundary = '--'.$boundary; rlm@37: $mail{body} = <