#!/usr/bin/perl $mailprog = '/usr/sbin/sendmail -t'; $admin_email="admin\@email.org"; $subject="Testing the new mass mailer"; $file = "/actapps/suitespot/cgi-bin/sender/returntest3.txt"; $number_sent = 0; open(DATA, "$file") || die "Can't open $file"; # open the file for reading while($line = ) { chop $line; ($junk,$email,$message,$survey_url,$login,$password) = split(/\|/,$line); open (MAIL, "|$mailprog -t") || die "Can't open $mailprog! \n"; print MAIL "Content-type:text/plain\n"; print MAIL "From: $admin_email\n"; print MAIL "To: $email\n"; print MAIL "Subject: $subject\n"; print MAIL "$message\n\n"; print MAIL "URL: $survey_url\n"; print MAIL "Login: $login\n"; print MAIL "Password: $password\n"; close(MAIL); $number_sent++; }