FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=16208&edit=1

ID: 16208
Updated by: daniel.oconnor@gmail.com
Reported By: pedro at ventre dot pt
Summary: Fatal error: Call to a member function setOption()
Status: Open
Type: Bug
Package: Mail_Queue
Operating System: Linux
Package Version: 1.2.2
PHP Version: 5.2.5
Roadmap Versions:
New Comment:

Test script:

$queue = new Mail_Queue(array(), array());

assert(!empty($queue->container));

Mail_Queue should return an error more obviously here.


Previous Comments:
------------------------------------------------------------------------

[2009-05-08 21:12:45] nimbor

Description:
------------
<?
require_once "Mail/Queue.php";
$arr = explode(";",urldecode($_REQUEST["email"]));
$i = 0;
while($i<count($arr))
{
$container_options = array(
'type' => 'db',
'database' => 'musicav_musica',
'phptype' => 'mysql',
'username' => 'musicav_musica',
'password' => '(Hk=S&b9{5h$',
'mail_table' => 'newsletter_queue',
);
// Options for configuring the Mail Queue
$options['driver'] = 'smtp';
$options['host'] = 'mail.musica.ventre.com';
$options['port'] = 25;
$options['auth'] = false;
// Authentication for your email account the email will be sent through

$options['username'] = 'musicav';
$options['password'] = 'lojamusica';
// We use the $db and $options here to initialize a new Mail_Queue
object
$queue =& new Mail_Queue($container_options, $options);
$mime =& new Mail_mime();
$mime->setTXTBody("Insert your message here");
// Alternatively you can use the setHTMLBody instead if you want to
send HTML based emails
// See
http://pear.php.net/package/Mail_Mime/docs/latest/Mail_Mime/Mail_mime.html#methodsetHTMLBody
for more info
// $mime->setHTMLBody($content);
// You can add attachments by using the following function (can call
multiple times)
// See
http://pear.php.net/package/Mail_Mime/docs/latest/Mail_Mime/Mail_mime.html#methodaddAttachment
for more info
//$mime->addAttachment($filename_with_path, $mime_type, $filename);
$to = $arr[$i];
$from = "info@musica.ventre.pt";
$hdrs = array( "To" => $to, "From" => $from, "Subject" => "Teste",
"Date" => date('r'));
// Turn this email into suitable MIME format
$body = $mime->get();
// Generate suitable headers given the information provided
$hdrs = $mime->headers($hdrs);
// Put the message in the queue
$queue->put($from, $to, $hdrs, $body);
$i++;
}
$max_send_attempts = 10;
// This will send a batch of emails from the queue
// The explanation of this function and its parameters can be found
here:
//
http://pear.php.net/package/Mail_Queue/docs/latest/Mail_Queue/Mail_Queue.html#methodsendMailsInQueue

$mail_queue =& new Mail_Queue($container_options, $mail_options);
$mail_queue->sendMailsInQueue();

echo "TRUE";
?>

Expected result:
----------------
I just wanted the script to send all emails but it gives-me this error


Fatal error: Call to a member function setOption() on a non-object in
/usr/local/lib/php/Mail/Queue.php on line 311

Please anyone can help?


Actual result:
--------------
Fatal error: Call to a member function setOption()

------------------------------------------------------------------------

Search Discussions

  • Daniel Oconnor at May 9, 2009 at 4:31 am
    Edit report at http://pear.php.net/bugs/bug.php?id=16208&edit=1

    ID: 16208
    Updated by: daniel.oconnor@gmail.com
    Reported By: pedro at ventre dot pt
    Summary: Fatal error: Call to a member function setOption()
    Status: Open
    Type: Bug
    Package: Mail_Queue
    Operating System: Linux
    Package Version: 1.2.2
    PHP Version: 5.2.5
    Roadmap Versions:
    New Comment:

    Pedro, as a workaround; do:


    $queue =& new Mail_Queue($container_options, $options);
    if ($queue->hasErrors()) {
    foreach ($queue->getErrors() as $error) {
    print $error->getMessage() . "\n";
    }

    die();
    }


    Previous Comments:
    ------------------------------------------------------------------------

    [2009-05-09 06:29:58] doconnor

    Test script:

    $queue = new Mail_Queue(array(), array());

    assert(!empty($queue->container));

    Mail_Queue should return an error more obviously here.

    ------------------------------------------------------------------------

    [2009-05-08 21:12:45] nimbor

    Description:
    ------------
    <?
    require_once "Mail/Queue.php";
    $arr = explode(";",urldecode($_REQUEST["email"]));
    $i = 0;
    while($i<count($arr))
    {
    $container_options = array(
    'type' => 'db',
    'database' => 'musicav_musica',
    'phptype' => 'mysql',
    'username' => 'musicav_musica',
    'password' => '(Hk=S&b9{5h$',
    'mail_table' => 'newsletter_queue',
    );
    // Options for configuring the Mail Queue
    $options['driver'] = 'smtp';
    $options['host'] = 'mail.musica.ventre.com';
    $options['port'] = 25;
    $options['auth'] = false;
    // Authentication for your email account the email will be sent through

    $options['username'] = 'musicav';
    $options['password'] = 'lojamusica';
    // We use the $db and $options here to initialize a new Mail_Queue
    object
    $queue =& new Mail_Queue($container_options, $options);
    $mime =& new Mail_mime();
    $mime->setTXTBody("Insert your message here");
    // Alternatively you can use the setHTMLBody instead if you want to
    send HTML based emails
    // See
    http://pear.php.net/package/Mail_Mime/docs/latest/Mail_Mime/Mail_mime.html#methodsetHTMLBody
    for more info
    // $mime->setHTMLBody($content);
    // You can add attachments by using the following function (can call
    multiple times)
    // See
    http://pear.php.net/package/Mail_Mime/docs/latest/Mail_Mime/Mail_mime.html#methodaddAttachment
    for more info
    //$mime->addAttachment($filename_with_path, $mime_type, $filename);
    $to = $arr[$i];
    $from = "info@musica.ventre.pt";
    $hdrs = array( "To" => $to, "From" => $from, "Subject" => "Teste",
    "Date" => date('r'));
    // Turn this email into suitable MIME format
    $body = $mime->get();
    // Generate suitable headers given the information provided
    $hdrs = $mime->headers($hdrs);
    // Put the message in the queue
    $queue->put($from, $to, $hdrs, $body);
    $i++;
    }
    $max_send_attempts = 10;
    // This will send a batch of emails from the queue
    // The explanation of this function and its parameters can be found
    here:
    //
    http://pear.php.net/package/Mail_Queue/docs/latest/Mail_Queue/Mail_Queue.html#methodsendMailsInQueue

    $mail_queue =& new Mail_Queue($container_options, $mail_options);
    $mail_queue->sendMailsInQueue();

    echo "TRUE";
    ?>

    Expected result:
    ----------------
    I just wanted the script to send all emails but it gives-me this error


    Fatal error: Call to a member function setOption() on a non-object in
    /usr/local/lib/php/Mail/Queue.php on line 311

    Please anyone can help?


    Actual result:
    --------------
    Fatal error: Call to a member function setOption()

    ------------------------------------------------------------------------
  • Daniel Oconnor at May 9, 2009 at 4:31 am
    Edit report at http://pear.php.net/bugs/bug.php?id=16208&edit=1

    ID: 16208
    Updated by: daniel.oconnor@gmail.com
    Reported By: pedro at ventre dot pt
    Summary: Fatal error: Call to a member function setOption()
    -Status: Open
    +Status: Verified
    Type: Bug
    Package: Mail_Queue
    Operating System: Linux
    Package Version: 1.2.2
    PHP Version: 5.2.5
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Verified




    Previous Comments:
    ------------------------------------------------------------------------

    [2009-05-09 06:30:58] doconnor

    Pedro, as a workaround; do:


    $queue =& new Mail_Queue($container_options, $options);
    if ($queue->hasErrors()) {
    foreach ($queue->getErrors() as $error) {
    print $error->getMessage() . "\n";
    }

    die();
    }

    ------------------------------------------------------------------------

    [2009-05-09 06:29:58] doconnor

    Test script:

    $queue = new Mail_Queue(array(), array());

    assert(!empty($queue->container));

    Mail_Queue should return an error more obviously here.

    ------------------------------------------------------------------------

    [2009-05-08 21:12:45] nimbor

    Description:
    ------------
    <?
    require_once "Mail/Queue.php";
    $arr = explode(";",urldecode($_REQUEST["email"]));
    $i = 0;
    while($i<count($arr))
    {
    $container_options = array(
    'type' => 'db',
    'database' => 'musicav_musica',
    'phptype' => 'mysql',
    'username' => 'musicav_musica',
    'password' => '(Hk=S&b9{5h$',
    'mail_table' => 'newsletter_queue',
    );
    // Options for configuring the Mail Queue
    $options['driver'] = 'smtp';
    $options['host'] = 'mail.musica.ventre.com';
    $options['port'] = 25;
    $options['auth'] = false;
    // Authentication for your email account the email will be sent through

    $options['username'] = 'musicav';
    $options['password'] = 'lojamusica';
    // We use the $db and $options here to initialize a new Mail_Queue
    object
    $queue =& new Mail_Queue($container_options, $options);
    $mime =& new Mail_mime();
    $mime->setTXTBody("Insert your message here");
    // Alternatively you can use the setHTMLBody instead if you want to
    send HTML based emails
    // See
    http://pear.php.net/package/Mail_Mime/docs/latest/Mail_Mime/Mail_mime.html#methodsetHTMLBody
    for more info
    // $mime->setHTMLBody($content);
    // You can add attachments by using the following function (can call
    multiple times)
    // See
    http://pear.php.net/package/Mail_Mime/docs/latest/Mail_Mime/Mail_mime.html#methodaddAttachment
    for more info
    //$mime->addAttachment($filename_with_path, $mime_type, $filename);
    $to = $arr[$i];
    $from = "info@musica.ventre.pt";
    $hdrs = array( "To" => $to, "From" => $from, "Subject" => "Teste",
    "Date" => date('r'));
    // Turn this email into suitable MIME format
    $body = $mime->get();
    // Generate suitable headers given the information provided
    $hdrs = $mime->headers($hdrs);
    // Put the message in the queue
    $queue->put($from, $to, $hdrs, $body);
    $i++;
    }
    $max_send_attempts = 10;
    // This will send a batch of emails from the queue
    // The explanation of this function and its parameters can be found
    here:
    //
    http://pear.php.net/package/Mail_Queue/docs/latest/Mail_Queue/Mail_Queue.html#methodsendMailsInQueue

    $mail_queue =& new Mail_Queue($container_options, $mail_options);
    $mail_queue->sendMailsInQueue();

    echo "TRUE";
    ?>

    Expected result:
    ----------------
    I just wanted the script to send all emails but it gives-me this error


    Fatal error: Call to a member function setOption() on a non-object in
    /usr/local/lib/php/Mail/Queue.php on line 311

    Please anyone can help?


    Actual result:
    --------------
    Fatal error: Call to a member function setOption()

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMay 9, '09 at 4:30a
activeMay 9, '09 at 4:31a
posts3
users1
websitepear.php.net

1 user in discussion

Daniel Oconnor: 3 posts

People

Translate

site design / logo © 2022 Grokbase