Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl require "Lite.pm"; $address = "hgy.emllst"; # file with email addresses $email_template = "email-sept-20-06.html"; # the 'email' in html form +at (looks pretty) $subject = "News for September 2006"; open(E,$email_template); @F = <E>; close(E); $filehtml = join("",@F); ## open up the file with the email addresses open(A,$address) || die "could not open $address for reading\n"; ## read in the email addresses into the address array @addresses = <A>; ## for each address in the list for ($i=0; $i < @addresses; $i++) { if ($addresses[$i] ne "") { ## send the customer an email my $msg = MIME::Lite->new( From =>'news@xxxxxxxx.com', To =>"$addresses[$i]", Subject =>"$subject", Type =>'text/html', Data =>"$filehtml"); $msg->send(); } }
20060927 Janitored by Corion: Changed PRE to code tags, as per Writeup Formatting Tips
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sending out a mass email to our customers
by davorg (Chancellor) on Sep 27, 2006 at 11:04 UTC | |
|
Re: Sending out a mass email to our customers
by zentara (Cardinal) on Sep 27, 2006 at 12:22 UTC | |
|
Re: Sending out a mass email to our customers
by derby (Abbot) on Sep 27, 2006 at 12:30 UTC | |
|
Re: Sending out a mass email to our customers
by imp (Priest) on Sep 27, 2006 at 11:22 UTC | |
|
Re: Sending out a mass email to our customers
by jdtoronto (Prior) on Sep 27, 2006 at 15:10 UTC |