FuZion
03-11-2009, 12:49 AM
Hello there,
I am attempting to use the PEAR Mail_Queue tool on my shared server. However, I am getting this error when it is called:
<b>Fatal error</b>: Call to a member function put() on a non-object in <b>/usr/local/lib/php/Mail/Queue.php</b> on line <b>428</b><br />
I do not know what the problem is, this is the function that calls it, and the associated arrays that it needs:
$mail_db_options["type"] = "db";
$mail_db_options["dsn"] = "mysql://user:pass@host/db";
$mail_db_options["mail_table"] = "mail_queue";
$mail_options["driver"] = "smtp";
$mail_options["host"] = "localhost";
$mail_options["port"] = 25;
$mail_options["localhost"] = "localhost"; //optional Mail_smtp parameter
$mail_options["auth"] = false;
$mail_options["username"] = "user";
$mail_options["password"] = "pass";
function mailqueue_add( $to, $from, $subject, $msg, $otherHeaders = array() ) {
$queue =& new Mail_Queue($mail_db_options, $mail_options);
$otherHeadrs['To'] = $to;
$otherHeaders['From'] = $from;
$otherHeaders['Subject'] = $subject;
$mime =& new Mail_mime();
$mime->setTXTBody($msg);
$body = $mime->get();
$otherHeaders = $mime->headers($otherHeaders);
echo $body;
$queue->put($from, $to, $otherHeaders, $body);
}
Any help as to why this is happening is greatly appreciated!
Thanks!
I am attempting to use the PEAR Mail_Queue tool on my shared server. However, I am getting this error when it is called:
<b>Fatal error</b>: Call to a member function put() on a non-object in <b>/usr/local/lib/php/Mail/Queue.php</b> on line <b>428</b><br />
I do not know what the problem is, this is the function that calls it, and the associated arrays that it needs:
$mail_db_options["type"] = "db";
$mail_db_options["dsn"] = "mysql://user:pass@host/db";
$mail_db_options["mail_table"] = "mail_queue";
$mail_options["driver"] = "smtp";
$mail_options["host"] = "localhost";
$mail_options["port"] = 25;
$mail_options["localhost"] = "localhost"; //optional Mail_smtp parameter
$mail_options["auth"] = false;
$mail_options["username"] = "user";
$mail_options["password"] = "pass";
function mailqueue_add( $to, $from, $subject, $msg, $otherHeaders = array() ) {
$queue =& new Mail_Queue($mail_db_options, $mail_options);
$otherHeadrs['To'] = $to;
$otherHeaders['From'] = $from;
$otherHeaders['Subject'] = $subject;
$mime =& new Mail_mime();
$mime->setTXTBody($msg);
$body = $mime->get();
$otherHeaders = $mime->headers($otherHeaders);
echo $body;
$queue->put($from, $to, $otherHeaders, $body);
}
Any help as to why this is happening is greatly appreciated!
Thanks!