MyBB Community Forums

Full Version: pm sending issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When sending a pm I get this error:
    [invalid_recipients] => Array
        (
            [error_code] => invalid_recipients
            [data] => Array
                (
                    [0] => 48503, 38025, 49919, 43292, 1, 25523, 832
                )

        )

all uid are valid and have receivepms=1
What can cause this failure?
How do you send the PM? Do you validate it before using the PMhandler?
Yes I do. The code almost always works. This is just one specific case when it didn't.

$pmhandler = new PMDataHandler();
$pm_handler->admin_override = true;
$pm = array(
'fromid' => 0,
'subject' => "bla subject",
'message' => "bla bla"
);
$pm['to'] = '48503, 38025, 49919, 43292, 1, 25523, 832';

$pmhandler->set_data($pm);
if($pmhandler->validate_pm())
{
$pminfo = $pmhandler->insert_pm();
}
else {
mail('[email protected]', 'pm invalid (errors)', print_r($pmhandler->errors, true));
}