473,405 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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


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();
Jul 19 '05 #1
1 7227
> $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.

$bulk->servers([$server]);

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. :)

-Jim.....
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Thierry | last post by:
Hello all, The following code line : array_push($this->content, &$elt); produces the following error : Warning: Call-time pass-by-reference has been deprecated - argument passed by...
1
by: vikas.khengare | last post by:
Hi Friends.... I have AJAX code which giving "Permission denied to call method XMLHttpRequest.open" error. This error fired by FireFox 1.0 and IE 6 and with Tomacat 5.x. This code work very...
3
by: risrikanth | last post by:
hi, When iam executing the perl code iam getting error like"can't call method"bind_param_inout" with out package or object reference .here iam send little bit code plz check and can you tell me...
1
by: rob77 | last post by:
Hi guys, I am really new to this and I have had a slight scripting error. I get the following: Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference,...
3
by: sisqorap | last post by:
Hi all, I have this kind of warning and would like to have it solved: Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration...
2
by: iavian | last post by:
Hi All, Getting below error, what might be the issue... Can't call method "numify" without a package or object reference at /usr/local/lib/perl5/site_perl/5.6.1/OLE/Storage_Lite.pm line 1329. ...
0
by: tgkprog | last post by:
hi i'm trying to use Win32::IEAutomation to automate clickbank.com navigation and page saving i can login and go to the https://www.clickbank.com/account/showTransactions.htm page but cannot...
2
by: r_ahimsa_m | last post by:
Hello, I am learning PHP5. I need to parse XML file and I found a solution in some book on PHP5 ("PHP5 Programming" by Rasmus Lerdors and others). Unfortunately I have two problems that I don't...
4
by: Wiinie | last post by:
How can I fix the error "Can't call method "id" on unblessed reference" for the following code? sub language{ my $self = shift; if (!$self->{LANGUAGE}) { my @language = (); my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.