use vars qw ( %params ); %params = ( "To" => "ww\@disadvantage.org", "Bcc" => "%HoA{$j}", "Subject" => "A test from ww", "Reply-To" => "ww\@disadvantage.org", "body" => "This is just some simple test text from ww. When you receive it please simply 'FORWARD' it (do NOT 'REPLY') to me at \n\n'wheelerw\@disadvantage.org' \n\nso I can confirm that my test ran properly.\n\nThanks, in advance, for your help!\n", ); print "\n\n +++++++++++\n\nDumping \%params next:\n\n"; # debug print Dumper (%params); # debug print "\n Done dumping \%params\n\n +++++++++++\n\n"; # debug print "\n\n \$HoA{$j}' is: @{ $HoA{$j} }\n\n"; # debug exit; # debug =head sendmail ( ${ %params } ); =cut sleep (2); #120 in production } #### SUBS ##### # suffle array (Fisher-Yates) to minimize having any domain get all of a single batch. sub shuffle { my $individual = shift; my $i; for ($i = @$individual; --$i; ) { my $j = int rand ($i+1); next if $i == $j; @$individual[$i,$j] = @$individual[$j,$i]; } } sub sendmail { $params{Type} = 'text/plain' if ! exists $params{Type}; $params{From} = 'Postmaster@createyouradvantage.com' if ! exists $params{From}; print "\n\n======================================\n\n"; print Dumper (%params); print "\n======================================\n\n"; print Dumper (@{ $HoA{$j} }); print "\n======================================\n\n"; # my $msg = MIME::Lite->new (%params{$j}); print "\n\n -------------------------------\n"; my $msg->print_header(\*STDOUT); print "\n\n -------------------------------\n"; # $msg->send ('smtp', "fake.disadvantage.org", Timeout=>90) or die "Message send failed: $!"; # error ^: "no data in this part" return; }