use Net::SMTP; #use Mail::Bulkmail; #Couldn't get this working on my U server #use Mime::Lite; #Server didn't like this my $mail_from = 'me@server.ca';< my @mail_to = ('1@server.com','2@server.com',...); my $subject = 'My subject eh'; my $count = 0; my $index = 0; my $message = q( Some html text ); #SMTP aliases to be reused to lessen the server load by not keeping many ports open my $smtp1 = Net::SMTP->new('my.mailserver.ca'); my $smtp2 = Net::SMTP->new('my.mailserver.ca'); my $smtp3 = Net::SMTP->new('my.mailserver.ca'); my $smtp4 = Net::SMTP->new('my.mailserver.ca'); while($index<=$#mail_to) { $smtp1->mail($mail_from); $smtp1->recipient($mail_to[$index]); $smtp1->data(); $smtp1->datasend("To: $mail_to[$index]\n"); $smtp1-> datasend ("Subject: $subject\n"); $smtp1-> datasend ("Mime-Version: 1.0\;\n"); $smtp1-> datasend ("Content-Type: text/html; charset='ISO-8859-1';\n\n"); $smtp1->datasend($message); $smtp1->dataend(); $index++; $smtp2->mail($mail_from); $smtp2->recipient($mail_to[$index]); $smtp2->data(); $smtp2->datasend("To: $mail_to[$index]\n"); $smtp2-> datasend ("Subject: $subject\n"); $smtp2-> datasend ("Mime-Version: 1.0\;\n"); $smtp2-> datasend ("Content-Type: text/html; charset='ISO-8859-1';\n\n"); $smtp2->datasend($message); $smtp2->dataend(); $index++; $smtp3->mail($mail_from); $smtp3->recipient($mail_to[$index]); $smtp3->data(); $smtp3->datasend("To: $mail_to[$index]\n"); $smtp3-> datasend ("Subject: $subject\n"); $smtp3-> datasend ("Mime-Version: 1.0\;\n"); $smtp3-> datasend ("Content-Type: text/html; charset='ISO-8859-1';\n\n"); $smtp3->datasend($message); $smtp3->dataend(); $index++; $smtp4->mail($mail_from); $smtp4->recipient($mail_to[$index]); $smtp4->data(); $smtp4->datasend("To: $mail_to[$index]\n"); $smtp4-> datasend ("Subject: $subject\n"); $smtp4-> datasend ("Mime-Version: 1.0\;\n"); $smtp4-> datasend ("Content-Type: text/html; charset='ISO-8859-1';\n\n"); $smtp4->datasend($message); $smtp4->dataend(); $index++; $count += 4; if($count == 40) { sleep(60); $count = 0; } } $smtp1->quit; $smtp2->quit; $smtp3->quit; $smtp4->quit; print "Mail sent succesfully, I think :)";