Ok... I know there is got to be something simple that I forgot, but I for the life of me can't find it. Please, for the sake of the wall I keep slamming my head into, any insight would be helpful.
Every time I try and run my script I get: Can't call method "_not_worthless" on unblessed reference at /usr/lib/perl5/site_perl/5.8.0/Mail/Bulkmail.pm line 1700, <CONF> line 9
It's a pretty straight forward script (or so I'm thinking)
#!/usr/bin/perl
# Perl Script to handle mailing.
# This replaces the WAY TOO vulnerable majordomo system we were using.
use strict;
use DBI();
use Mail::Bulkmail;
use Mail::Bulkmail::Server;
# Die if we don't have the right number of parameters.
die ("Usage: ./mailbot.pl uid mailoutid\n") if ($#ARGV != 1);
my $uid = $ARGV[0];
my $moid = $ARGV[1];
# Setup the database.
my $dbh = DBI->connect("DBI:mysql:database=x:host=localhost","x" ,"x");
my $sth = $dbh->prepare("SELECT * FROM newemails WHERE uid=$uid AND active=1");
$sth->execute();
# Migrate all that returns to an array for processing.
my @maillist = [];
while (my $ref = $sth->fetchrow_hashref()) {
push(@maillist,$ref->{'address'});
}
for ($a = 0; $a < @maillist; $a++) {
print("$maillist[$a]\n");
}
# Setting up the mail
my $server = Mail::Bulkmail::Server->new(
'Smtp' => '127.0.0.1',
'Port' => 25
) || die Mail::Bulkmail::Server->error();
my $bulk = Mail::Bulkmail->new() || die Mail::Bulkmail->error();
$bulk->From("myaddress\@somewhere.com");
$bulk->Sender("myaddress\@somewhere.com");
$bulk->ReplyTo("myaddress\@somewhere.com");
$bulk->Subject("Test");
$bulk->Message("Ooooo!");
$bulk->use_envelope(0);
$bulk->Trusting(1);
$bulk->servers([\$server]);
$bulk->LIST(@maillist);
$bulk->bulkmail() || die $bulk->error;
$sth->finish();
$dbh->disconnect();