1
I'm writing a php script that needs to send a message to a user. This is my code:
$message = "foo";
$pm_handler =& xoops_gethandler('privmessage');
$pm =& $pm_handler->create();
$pm->setVar("subject", "bar");
$pm->setVar("msg_text", $message);
$pm->setVar("to_userid", $uid);
$pm->setVar("from_userid", 1);
$pm_handler->insert($pm) or die('Failed to send.');
All my variables used, such as $uid and $message, are correctly set, but every time I try to execute the script, I will consitently get the die message "Failed to send." I don't get any error messages with PHP debug on, serverside enabled E_ALL or XOOPS admin PHP debug enabled.
Have I forgotten something as simple as an include? Not that I can see, but I'd appreciate any help that you folks can lend!
Thanks in advance :)