#!/usr/bin/perl -wd # use MIME::Lite; ### Create a new multipart message: $msg = MIME::Lite->new( From => 'foo@bar.com', To => 'bar@foo.com', Subject => 'A message with 2 parts...', Type => 'multipart/mixed' ); $msg->attach( Type => 'TEXT', Data => "Here's the file you wanted" ); $msg->attach( Type => 'text/plain', Path => 'baz.txt', Filename => 'baz.txt', Disposition => 'attachment' ); $msg->send; #### $msg->attach( Type => 'text/plain', Path => 'foo.txt', Filename => 'foo.txt', Disposition => 'attachment', Callback => \&hashit, ); $msg->send; sub hashit { print STDERR "#"; }