$msg = MIME::Lite->new( To =>$ToEmail, From =>$FromName, Subject =>$Subject, Type =>'multipart/related' ); $msg->attach( ############################## # Called HTML script here... # ############################## {open (my $fh,"<","sample.html" ) or die $!; local $/=undef; <$fh>} ); $msg->attach( Type => 'image/gif', Id => "$Attachment", Path => "$Attachment" );