in reply to Re: Re: Sending two messages thru an smtp server with authentication
in thread Sending two messages thru an smtp server with authentication

So what happens if you put a sleep statement at the end of the loop? Something like:
#!/usr/bin/perl use Net::SMTP; use strict; use warnings; for(1..2) { my $smtp = Net::SMTP->new('smtpauth.earthlink.net', Hello => 'milkbone.org', Debug => 1) or die +"death"; $smtp->auth('batkins86@earthlink.net', '***************************' +); $smtp->mail('monitor@milkbone.org'); $smtp->to('test@batkins.com'); $smtp->data(); $smtp->datasend("To: postmaster\n"); $smtp->datasend("\n"); $smtp->datasend("A simple test message\n"); $smtp->dataend(); $smtp->quit; sleep(5); }

Perhaps Net::SMTP hasn't fully cleaned up before you call it again? Don't think it would matter but I'm trying to cover all the bases...

  • Comment on Re: Re: Re: Sending two messages thru an smtp server with authentication
  • Download Code