#!/usr/bin/perl -w $mailprog = '/usr/lib/sendmail'; $mail = 'recipient-email@adress.com'; $from = 'sender-email@address.com'; $file = 'report.txt'; $col = 2; if (($ENV{QUERY_STRING} eq "new") && (-e $file)){unlink($file);} open (DATA, $file); $num = ; close (DATA); if ($num eq "") {$num = 0;} for ($i = 1; $i<=$col; $i++){$n = $i + $num; open (MAIL, "|$mailprog -t"); print MAIL "Content-Type: text/plain; charset = windows - 1251\n"; print MAIL "Subject: Text, Text!\n"; print MAIL "To: $mail\n"; print MAIL "From: $from\n\n"; print MAIL "Hello, the message text itself..\n"; print MAIL "\n\n"; close (MAIL); } open (DATA, ">$file"); print DATA $num+$col; close (DATA); print "Content-type: text/html\n\n"; print "$num\n"; print " \n";