#!/usr/bin/perl5.8.0 use MIME::Lite; $MIME::Lite::AUTO_CONTENT_TYPE = 1; ### Start with a simple text message: $msg = MIME::Lite->new( From =>'gubevijay@india.com', To =>'gubevijay@gmail.com', Subject =>'A message with 2 parts...', Type =>'multipart/mixed', ) or die "Error creating multipart $! \n"; # - add the text message part $msg->attach ( Type => 'TEXT', Data => 'hai, how are u', ) or die "Error adding the text message part: $!\n"; ### Attach a part... the make the message a multipart automatically: $msg->attach(Type =>'AUTO', Path =>'/root/logo.gif', Filename =>'logo.gif', Disposition =>'attachment' ) or die "Error adding logo.gif: $!\n"; if ($msg->send()) { print "ok"; } else { print "Error sending"; }