#!/usr/bin/perl use warnings; use strict; use MIME::Lite; use Net::SMTP; my $smtp = Net::SMTP ->new('yourmail.server'); #identify yourself to the server $smtp->mail('you@yourdomain'); $smtp->to('zentara@foobar.org'); $smtp->data( ); my $msg = MIME::Lite->new( From =>'Joe', To =>'Shmoe', Subject =>'HTML Test', Type =>'multipart/related', ); $msg->attach( Type => 'text/plain', Data => 'HERE IS YOUR HTML PAGE', ); $msg->attach( Type => 'text/html', Path =>'path_to_full_file_name', Disposition => 'attachment', ); # send the message over $smtp->datasend( $msg->as_string() ); # close smtp connection $smtp->dataend(); $smtp->quit;