#!/usr/bin/perl -w use MIME::Lite; my $from = shift || die "No sender"; my $to = shift || die "No email"; my $subject = shift || die "No subject"; my $data = shift || die "No text"; my $file = shift || die "No file"; my $filename = shift || die "No filename"; $msg = MIME::Lite->new( From => $from, To => $to, Subject => $subject, Type => 'text/plain', Data => $data); $msg->attach(Type=>'application/x-tar', Path => $file, Filename => $filename); $msg->send;