#!/usr/bin/perl require MIME::Base64; require Authen::SASL; use Net::SMTP; use Parallel::ForkManager; print "From address->email@domain.com: "; $from = <>; chomp $from; print "From name->Name: "; $fromname = <>; chomp $fromname; print "Subject->This is a test: "; $subject = <>; chomp $subject; print "Mail file->mail.txt: "; $mail = <>; chomp $mail; print "Addresses file->addresses.txt: "; $addresses = <>; chomp $addresses; print "SMTP file->smtp.txt: "; $smtpfile = <>; chomp $smtpfile; print "Max parallel SMTP->30: "; $max = <>; chomp $max; print "Max addresses per SMTP->10: "; $maxaddresses = <>; chomp $maxaddresses; open(MAIL, $mail); @boday = ; close(MAIL); $body = ""; foreach $pew (@boday) { $body.="$pew"; } open(my $y, "<", "$smtpfile") or die "$smtpfile: $!"; my @y = <$y>; close($y); chomp @y; open(INFO, $addresses); @addresses = ; close(INFO); $" = ","; chomp @addresses; $pm = new Parallel::ForkManager($max); foreach $target (@addresses) { chomp $target; @tenaddresses = splice(@addresses, 0, $maxaddresses); $index_y++; $index_y = 0 if($index_y > $#y); my $pid = $pm->start and next; my $value = "$_$y[$index_y]"; @info = split(/ /, $value); $server = $info[0]; $username = $info[1]; $pass = $info[2]; print "[+] Sending with $server to @tenaddresses | "; $connection = Net::SMTP->new($server, Timeout => 10, Debug => 0, ); if (!defined($connection) || !($connection)) { print ("Error at connecting. Skipping.\n"); } else { $connection->auth($username, $pass); $connection->mail($from); $connection->recipient(@tenaddresses); $connection->data; $connection->datasend("From: $fromname <$from>\r\n"); $connection->datasend("Content-Type: text/html \r\n"); $connection->datasend("Subject: $subject\r\n"); $connection->datasend("\r\n"); $connection->datasend("$body\r\n"); $connection->datasend("\r\n"); $connection->dataend(); $connection->quit; print ("Done.\n"); } $pm->finish; }