#!/usr/bin/perl -w use strict; use MIME::Lite; #stripped down Mailer w/ MIME encoding use HTML::Template; # use IO::File; #for easy file reading my $io = new IO::File "emaillist2.txt"; while ( my $address = $io->getline ){ chomp($address); my $template = HTML::Template->new(filename => 'free_ipod.tmpl'); my $email_html = $template->output; my $msg = MIME::Lite->new( To =>$address, From => 'survey@xxxxx.com', Subject =>'Win a free ipod', Type =>'multipart/related' ); MIME::Lite->send('smtp', "istate1.corp.xxxxx.com", Timeout=>60); $msg->attach(Type => 'text/html', Data => $email_html ); $msg->attach(Type => 'image/gif', Id => 'IS093-043_emailanim.gif', Path => 'IS093-043_emailanim.gif', ); $msg->send(); }