my $msg = MIME::Lite->new( From => $from, To => $to, Subject => $subject, Type => "multipart/mixed" ); $msg->attach(Type => "Text", Data => $data); $msg->attach(Type => "application/pdf", Path =>"/tmp/test.pdf", Filename =>"test.pdf", Disposition =>"attachment" ); # Somehow the direct send() didn't work for me # so I resorted to the old fashioned way open(MAIL, "|/usr/sbin/sendmail -t"); print MAIL $msg->as_string; close(MAIL);