I don't know how to even start debugging. The error message was lost.
foreach $addr (@addresses) {
$smtp = Net::SMTP->new($host) ¦¦ print "couldn't do the new command<BR>\n";
$smtp->mail('$address') ¦¦ print "couldn't tell it the sender<BR>\n";
$smtp->to($addr) ¦¦ print "couldn't tell it the recipient ($addr)<BR>\n";
$smtp->data() ¦¦ $smtp->data() ¦¦ print "There was a problem starting for $addr<BR>\n";
$smtp->datasend("Reply-to: $replyto\n") ¦¦ $smtp->datasend("Reply-to: $replyto\n") ¦¦ print "There was a problem sending replyto for $addr<BR>\n";
$smtp->datasend("Subject: $subject\n\n") ¦¦ $smtp->datasend("Subject: $subject\n\n") ¦¦ print "There was a problem sending subject for $addr<BR>\n";
$smtp->datasend("$message\n\n") ¦¦ $smtp->datasend("$message\n") ¦¦ print "There was a problem sending message for $addr<BR>\n";
$smtp->datasend("$trailer\n\n") ¦¦ $smtp->datasend("$trailer\n\n") ¦¦ print "There was a problem sending trailer for $addr<BR>\n";
$smtp->dataend() ¦¦ $smtp->dataend() ¦¦ print "There was a problem ending for $addr<BR>\n";
$smtp->quit;
}
I tried doing it by listing multiple recipients, but that didn't work. That's why it's all in a loop. Inelegant I know, but like I said, it worked for 4 addresses.
Any suggestions? This is my first attempt at a mass mailing.
Bob the desperate
My client sent out her email. My Perl program ran for 5 hours, mostly sleeping, sending out one email every 40 seconds, to avoid sending too often. It writes to a file when there is a problem. There was only one problem. It writes to another file when it is done sending emails. It got to the end of the list. Great.
But my email address is at the end of the list, and I didn't get an email.
Am I supposed to reset if something goes wrong? That's the only thing I can think of.
Part of my problem is that the program usually runs fine when I tested; at least, I do not recall this problem. I can't have my client testing it on her 500 email addresses (more often than she already has).
My code, in case that helps, a little cleaned up. It runs through this for every person. The reported failures were for one person on $smtp->to and $smtp->data()
$smtp = Net::SMTP->new($host);
$smtp->mail('@emailaddress') ¦¦ print DATA2 "sender; $addr<BR>\n";
$smtp->to($addr) ¦¦ print DATA2 "recipient($addr)<BR>\n";
$smtp->data() ¦¦ print DATA2 "starting for $addr<BR>\n";
$smtp->datasend("Reply-to: $replyto\n") ¦¦ print DATA2 "sending replyto for $addr<BR>\n";
$smtp->datasend("Subject: $subject\n\n") ¦¦ print DATA2 "There was a problem sending subject for $addr<BR>\n";
$smtp->datasend("$message\n\n") ¦¦ print DATA2 "There was a problem sending message for $addr<BR>\n";
$smtp->dataend() ¦¦ print DATA2 "There was a problem ending for $addr<BR>\n";
$smtp->quit;
Bob