in reply to Re^6: Net::SMTP newsletter
in thread Net::SMTP newsletter

What part of the code do you have problems with? My code is a self-contained example of how to easily do things in parallel by using threads. I'm sure you could basically do the same using Parallel::ForkManager. So maybe you want to do that.

Replies are listed 'Best First'.
Re^8: Net::SMTP newsletter
by commonlybon (Initiate) on Dec 22, 2008 at 16:23 UTC
    Fast answer...anyway with Parallel::ForkManager I can only send to 1 e +mail at a time...I just can't make it take the first 10 emails in 1 f +ork and the next 10 in the second fork...This is what I want to do

      Just do it just like I did in my example. I partitioned the addresses into batch jobs of size 10, just like my comments say. That happens even before I start the parallel processing. So just use the code I showed to feed each Parallel::ForkManager run with 10 addresses instead of just with one.

        Corion please heeeelllppp :D...Make me a christmas present and help me + find this code :P Really these days i tried and tried and tried all +over again but with no success...In parallel forkmanager it's impossi +ble to have double loops for the smtp and addresses in the same time +and with your code I just can't make my script to work...I just want +to take 10 addresses at a time with splice that is easy to make even +for parallel fork manager but when I put the smtp servers with splice + too it only takes the addresses fine but the servers no...I managed +to make a code like this : #!/usr/bin/perl use Parallel::ForkManager; $fileaddress = $ARGV[0]; open(INFO, $fileaddress); @addresses = <INFO>; close(INFO); $" = ","; chomp @addresses; $pm = new Parallel::ForkManager(2); while (@addresses) { @tenaddresses = splice(@addresses, 0, 10); my $pid = $pm->start and next; print "The ten values are @kkt2 : @tenaddresses\n"; $pm->finish; } How do I make that code to take the smtp servers from file smtp.txt an +d inside the "my $pid = $pm->start and next;" to put a smtp server ev +ery 10 addresses then send with 2 parallel forks at a time...sleep 10 + and take the next 2 parallel forks and the next 10 addresses each ( +every fork has it's own smtp server and it's own 10 addresses )...Mak +e it only print Sending with $smtpserver to this ten addresses : @add +resses...Please help i don't know where else to search for help