Creating a newsletter program

Hi!
I hope this is the right place to talk about this.
I am currently using a program on my website which delivers every night a message to 6500+ persons (growing)
The program is written in Perl, and it's quite simple: after having extracted emails from the DB it enters a "for" loop which calls a small procedures which:

a) opens a pipe with the sendmail program:
open(MAIL, "| /usr/sbin/sendmail -t");
b) executes these instructions:
print MAIL "To: <$recipient>\n";
print MAIL "From: \"me\" <me\@host.com>\n";
print MAIL "Subject: $subject\n";
print MAIL "\n";
# subject
print MAIL "$body\n";
c) closes the pipe:
close(MAIL);
d) exits the procedure and goes back to the "for" loop

Should it be done better? Or every package out there (such as GNU mailman, majordomo, etc.) works this way? If not, how?

Please help, I'm looking for a new host and I've been told that the execution of this script in the crontab is conditioned upon how the script is written.

Any suggestion to improve speed and reduce server load? Or is it good enough? I don't want to use standard mailing list packages.
Thanks in advance.

Best regards, Creating a newsletter program

 

 

 

 

Top