my $msg = MIME::Lite->new( From =>$Input{'email'}, To =>$Input{'sender'}, Subject =>'New message', Type =>'multipart/mixed' ); $msg->attach(Type =>'TEXT', Data =>"$Input{'message'}" ); open(FILE, "attach.txt"); my @lines = ; close(FILE); foreach my $line(@lines){ $msg->attach(Type =>'image/gif', Path =>"/u619/be/bon/uploads/$line", Filename =>"$line", Disposition => 'attachment' ); } $msg->send; print "Content-type: text/html\n\n"; print "

MAIL SENT

";