On Sat, Jul 05, 2003 at 12:43:10AM +0000, Pablo Fischer wrote:
> Hi all!
> 
> My name is Pablo Fischer and Im a little new in Perl, however I have a project 
> where I need to parse mails and send mails:
> 
> I receive 2 files (contacts and arguments), I get 2000 mail adds from the 
> file, so I need to make packages of 100 mails with differents email adds, 
> When I have the package I need to send this mails with sendmail to each 
> address, however, it sounds very easy (just parse and send mails), but the 
> funny thing starts here:
> 
> I Cannot send 15 mails of *.prodigy.net.mx (an ISP of my country) because this  
> ISP will block my IP. So, exists a form to mix sendmail and perl, or how to 
> do it in sendmail to: dont send 100 packages in a second, send them like 
> 10,10,10..1000, in other words: how to work with threads in sendmail.


Pablo,

If I understand correctly, you just want to pause between sending your
mails so that the ISP doesn't interpret you as a spammer, right?  You
can do that like this:

  use Mail::Sendmail;

  $i = 100;
  while ($i--) {
    $body_of_message = ...;

    %mail = ( To      => '[EMAIL PROTECTED]',
              From    => '[EMAIL PROTECTED]',
              Subject => 'mailadds, group ' . (100 - $i + 1),
              Message => $body_of_message,
            );
    sendmail(%mail) or die $Mail::Sendmail::error;
    print "OK. Log says:\n", $Mail::Sendmail::log;

    sleep 1;  # Wait 1 second before sending next batch
  }

You can get Mail::Sendmail from CPAN: 

http://search.cpan.org/author/MIVKOVIC/Mail-Sendmail-0.79/Sendmail.pm

--Dks

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to