--- x 2009-09-29 21:00:01.392812366 +0200 +++ perl.scrap.mime-lite-mail-sending 2009-09-29 17:56:51.900791614 +0200 @@ -1,23 +1,27 @@ +use MIME::Lite; +$html="testhtml"; +$text="testtext"; my $message = MIME::Lite->build ( From =>'someemail', - To =>'anotheremail', # a present from peter to postfix :) + To =>'jakobi', Subject=>'somesubject', Type =>'multipart/alternative' ); # this is the if(1) note if ('i have a attachment') { $message->replace(Type => 'multipart/mixed'); $message->attach( Type=> 'AUTO', # this is your major issue: **Path being undefined** - Path=> $upload_file, + Path=> '/etc/hosts', Filename=>$basename, Disposition => 'attachment' ); } # this might be a prob or might be no prob; # but usually it's text/plain in emails - $message->attach(Type=> 'TEXT', + $message->attach(Type=> 'text/plain', # TEXT Data=> $text, ); $message->attach(Type=> 'text/html', Data=> $html ); $message->send('smtp','000.000.000.000', Debug=>1,Timeout=>60,Port=>26);