By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 2,028 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

Mail::Bulkmail - Can't call method "_not_worthless" on unblessed reference at

P: n/a

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/ line 1700, <CONF> line 9

It's a pretty straight forward script (or so I'm thinking)


# 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: ./ 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");
# Migrate all that returns to an array for processing.
my @maillist = [];

while (my $ref = $sth->fetchrow_hashref()) {

for ($a = 0; $a < @maillist; $a++) {
# Setting up the mail
my $server = Mail::Bulkmail::Server->new(
'Smtp' => '',
'Port' => 25
) || die Mail::Bulkmail::Server->error();

my $bulk = Mail::Bulkmail->new() || die Mail::Bulkmail->error();

$bulk->bulkmail() || die $bulk->error;

Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
> $bulk->servers([\$server]);

That's a bug in the documentation, it'll be fixed in the next release.
Don't hand in refs to the server objects.


Incidentally, the preferred method is to specify the server information
in the conf file by having it point to a server_file. Much easier to
configure that way.

And, finally, I respond quicker to emails than newsgroup postings, as a
general rule, in case there are any future issues. :)

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.