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