I believe you need to re-create the object for each message.... You are opening a connection, then you quit the connection then every subsequent message is sent to the bit bucket.
Personally I would create a connection to the email server, send you email, quite that session then start again with another connection. -d David K Hill -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dirk Bremer Sent: Friday, February 03, 2006 9:38 AM To: [email protected] Subject: Net::SMTP Question I have a need to send multiple email messages within a single instance of a program. I have a problem where the first composed email message is sent (and received) okay, while the subsequent messages are not. The code is similar to this: use Net::SMTP; $smtp = Net::SMTP->new('mailhost'); $smtp->mail($ENV{USER}); # Loop over the following for each message $smtp->to('postmaster'); $smtp->data(); $smtp->datasend("To: postmaster\n"); $smtp->datasend("\n"); $smtp->datasend("A simple test message\n"); $smtp->dataend(); $smtp->quit; Note the loop as shown above. What am I doing wrong? Do I need to create a new SMTP object for each message? Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis MO - USA Central Time Zone 636-755-2652 fax 636-755-2503 [EMAIL PROTECTED] www.nisc.coop _______________________________________________ Perl-Win32-Users mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Win32-Users mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
