use strict; use warnings; use File::Basename qw( basename ); use MIME::Lite qw( ); my $msg = MIME::Lite->new( From => 'me@myhost.com', To => 'you@yourhost.com', Cc => 'some@other.com, some@more.com', Subject => 'A message with 2 parts...', Type => 'multipart/mixed' ); $msg->attach( Type => 'TEXT', Data => "Here's the file you wanted" ); $msg->attach( Type => 'application/perl', Path => $0, Filename => basename($0), Disposition => 'attachment' ); $msg->print();