Mercurial > laserkard
view megamail.pl @ 43:329638a361cc laserkard
[svn r44] implemented redraw memory.
author | rlm |
---|---|
date | Thu, 28 Jan 2010 00:32:54 -0500 |
parents | 021a9ab1ed5b |
children |
line wrap: on
line source
1 use MIME::QuotedPrint;2 use MIME::Base64;3 use Mail::Sendmail 0.75; # doesn't work with v. 0.74!5 %mail = (6 from => 'rlm@mit.edu',7 to => 'rlm@mit.edu',8 subject => 'Test attachment',9 );12 $boundary = "====" . time() . "====";13 $mail{'content-type'} = "multipart/mixed; boundary=\"$boundary\"";15 $message = encode_qp( "email from your friend PERL." );17 $file = "./inkscape/arrow.svg";19 open (F, $file) or die "Cannot read $file: $!";20 binmode F; undef $/;21 $attach1 = encode_base64(<F>);22 close F;26 $attach2 = encode_base64("hi this is a test arttacghjkalsdlasndlashdlsf");32 $boundary = '--'.$boundary;33 $mail{body} = <<END_OF_BODY;34 $boundary35 Content-Type: text/plain; charset="iso-8859-1"36 Content-Transfer-Encoding: quoted-printable38 $message39 $boundary40 Content-Type: application/octet-stream; name="test.svg"41 Content-Transfer-Encoding: base6442 Content-Disposition: attachment; filename="test.svg"44 $attach146 $boundary47 Content-Type: application/octet-stream; name="huh.txt"48 Content-Transfer-Encoding: base6449 Content-Disposition: attachment; filename="huh.txt"51 $attach252 $boundary--54 END_OF_BODY56 sendmail(%mail) || print "Error: $Mail::Sendmail::error\n";