public static function deleteOutboxEmail($id)
    {
        global $PPHP;
        $db = $PPHP['db'];

        $q = $db->query('DELETE FROM emails WHERE id=?', $id);
        if (!pass('has_role', 'admin')) {
            $q->and('sender=?', $_SESSION['user']['id']);
        };
        $res = $db->exec($q);
        if ($res !== false) {
            trigger('outbox_changed');
        };
        return $res;
    }