D
\Dandy\ Randy
Hello, I have created a mailing program for our company that sends out
emails to our client database. There seems to be a delay in the script or
the processing of the emails. Here is how it works. The email addresses are
stored in a simple text file, one on top of each other. Each email is sent
through a foreach loop. I use this code to get email addresses and send the
emails:
open (ADDRESSES, "<address.txt") or die "Can't open file: $!";
@list=<ADDRESSES>;
close(ADDRESSES);
$mailprog="/usr/sbin/sendmail -t";
foreach $list (@list) {
chomp ($list);
($name,$email)=split(/\|/,$list);
open (MAIL, "|$mailprog") or die "Can't open main program: $!";
print MAIL "From: $adminname <$adminemail>\n";
print MAIL "To: $fullname <$email>\n";
print MAIL "Subject: $subject\n";
print MAIL "MIME-Version: 1.0\n";
print MAIL "X-MSMail-Priority: $priority\n";
print MAIL "Content-Type: multipart/alternative;\n";
print MAIL " boundary=\"separator\"\n\n";
print MAIL "This is a multi-part message in MIME format.\n\n";
print MAIL "--separator\n";
print MAIL "Content-Type: text/plain;\n";
print MAIL " charset=\"iso-8859-1\"\n\n";
print MAIL "@textonly\n\n";
print MAIL "--separator\n";
print MAIL "Content-Type: text/html;\n";
print MAIL " charset=\"iso-8859-1\"\n\n";
print MAIL "@content\n\n";
print MAIL "--separator--";
close (MAIL);
}
print "Confirmation Message";
For testing purposes, the address.txt file contains 100 email addresses ...
all different, but in the end end up in my inbox ... so if I recieve 100
emails the script works. Well it does ... I do get the 100 emails but heres
the thing ... almost right away I get about 60-70 emails ... but then the
other 30 seem to get delivered at random intervals. Some take 5 minutes,
some take 5 hours. I am puzzled why so many take so long to get delivered?
Am I overloading sendmail? or maybe my email account? Your
thoughts/reccommendations are appriciated.
Randy
emails to our client database. There seems to be a delay in the script or
the processing of the emails. Here is how it works. The email addresses are
stored in a simple text file, one on top of each other. Each email is sent
through a foreach loop. I use this code to get email addresses and send the
emails:
open (ADDRESSES, "<address.txt") or die "Can't open file: $!";
@list=<ADDRESSES>;
close(ADDRESSES);
$mailprog="/usr/sbin/sendmail -t";
foreach $list (@list) {
chomp ($list);
($name,$email)=split(/\|/,$list);
open (MAIL, "|$mailprog") or die "Can't open main program: $!";
print MAIL "From: $adminname <$adminemail>\n";
print MAIL "To: $fullname <$email>\n";
print MAIL "Subject: $subject\n";
print MAIL "MIME-Version: 1.0\n";
print MAIL "X-MSMail-Priority: $priority\n";
print MAIL "Content-Type: multipart/alternative;\n";
print MAIL " boundary=\"separator\"\n\n";
print MAIL "This is a multi-part message in MIME format.\n\n";
print MAIL "--separator\n";
print MAIL "Content-Type: text/plain;\n";
print MAIL " charset=\"iso-8859-1\"\n\n";
print MAIL "@textonly\n\n";
print MAIL "--separator\n";
print MAIL "Content-Type: text/html;\n";
print MAIL " charset=\"iso-8859-1\"\n\n";
print MAIL "@content\n\n";
print MAIL "--separator--";
close (MAIL);
}
print "Confirmation Message";
For testing purposes, the address.txt file contains 100 email addresses ...
all different, but in the end end up in my inbox ... so if I recieve 100
emails the script works. Well it does ... I do get the 100 emails but heres
the thing ... almost right away I get about 60-70 emails ... but then the
other 30 seem to get delivered at random intervals. Some take 5 minutes,
some take 5 hours. I am puzzled why so many take so long to get delivered?
Am I overloading sendmail? or maybe my email account? Your
thoughts/reccommendations are appriciated.
Randy