#!/usr/bin/perl -w

# massemail.pl 
# Copyright (c) 2004 Jeremy P. Portzer <jeremy@trilug.org>
# Released under the GNU General Public License 2.0

use strict;
use Mail::Sendmail;


my $message =
qq|From:    Abe Lincoln - Director of Instructional Computing
Subject: Evaluations for Online Courses

Hello,

To help us assess the quality of our on-line courses and to 
identify areas where we can make improvements, we would like you to 
complete a course evaluation and an instructor evaluation for the online 
course(s) in which you are enrolled this semester.

[further information including web link deleted]
|;

while(<>)
{
	chomp;
	s/^\s+//;	#remove leading whitespace
	my ($userid,$fname,$lname,$email) = split /\s+/ ;	#split on whitespace
my $newmessage =qq|To:      $fname $lname
$message
|;
	my %mail = ( To => "$fname $lname <$email>",	
		From    => 'Abe Lincoln <Abe.Lincoln@example.com>',
		Message => $newmessage,
		Subject => "Evaluations for Online Courses - Please Read"
		);
	print "Sending to $fname $lname <$email>\n";
	sendmail(%mail) or die $Mail::Sendmail::error;
	`usleep 100000`;
}

