$email->message = $message; preg_match("/.*\\[ticket:([^:]*):([^:]*)\\].*/i", $subject, $matches); print_r($matches); if (!$matches) { $param['subject'] = $subject; $param['descr_f'] = $message; $param['sent_to'] = 'client-admin'; $param['category'] = 'complaint'; $param['priority'] = 'medium'; $csq = new Sqlite(null, 'client'); $c = $csq->getRowsWhere("contactemail = '{$smallfrom}'", array('nname')); if ($c) { $clientname = $c[0]['nname']; $client = new Client(null, null, $clientname); $client->get(); $param = ticket::add($client, 'ticket', $param); $tick = new Ticket(null, null, $param['nname']); $tick->create($param); $tick->postAdd(); $tick->was(); } else { $m = "There is no user with your from address in the system."; $m .= "-------------------\n.........{$content}"; mail($smallfrom, "HelpDesk Failed", $m); } exit; } $ticketid = $matches[2]; $pclass = "client"; $pname = $matches[1]; if (cse($pname, ".vm")) {