Code:
$botpermissions['adminpermissions'] = 2;
$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);
$pmdm->set('fromuserid', '2');
$pmdm->set('fromusername', 'Dman');
$pmdm->set('title', $pmt);
$pmdm->set('message', $pms);
$pmdm->set_recipients($uname, $botpermissions);
$pmdm->set_info('receipt', false);
$pmdm->set_info('savecopy', false);
$pmdm->overridequota = true;
$pmdm->set('dateline', TIMENOW);
$pmdm->save();
I am trying to use this code, to send PM it works but when user choosed "not to receive PM" this code returns error. Any work around ? And all the queries are made after $pmdm->save(); right ?