Maybe Most efficient way to send mass email?
Most people use MiME::Lite to avoid those hassles.
I think the preferred way to do it is with a Bcc list, but your ISP may think you are spamming.
#! /usr/bin/perl -w
#
#This program takes a list of email addresses and emails them.
#NOTE: This program must be changed for each edition of the newsletter
#
use strict;
use MIME::Lite;
open(INDEX, "<index.htm") or die "Can't open index.htm file";
my $body = do { local $/; <INDEX> }; #Slurp the whole file in
close(INDEX);
my $msg = MIME::Lite->new(
Subject =>'New phase of funding to support life-saving vaccines
+',
Type =>'multipart/related',
);
$msg->attach(Type =>'text/html', Data =>$body, Disposition=>'inline');
$msg->attach(Type =>'image/jpg', Path =>'index_files/Hivheader1.jpg',
+Disposition=>'inline');
$msg->attach(Type =>'image/jpg', Path =>'index_files/image001.jpg', Di
+sposition=>'inline');
$msg->attach(Type =>'image/jpg', Path =>'index_files/image002.jpg', Di
+sposition=>'inline');
$msg->attach(Type =>'image/gif', Path =>'index_files/image003.gif', Di
+sposition=>'inline');
$msg->attach(Type =>'image/jpg', Path =>'index_files/image004.jpg', Di
+sposition=>'inline');
$msg->attach(Type =>'image/jpg', Path =>'index_files/image005.jpg', Di
+sposition=>'inline');
$msg->attach(Type =>'image/jpg', Path =>'index_files/image006.jpg', Di
+sposition=>'inline');
while (<>) {
$msg->add(To=>"$_");
$msg->send("sendmail","/usr/bin/qmail-inject");
}; #while there are more address on the command line
|