public static function sendOutboxEmail($id, $tampered = true)
    {
        global $PPHP;
        $db = $PPHP['db'];

        $mailfrom = null;
        $cc = null;
        $bcc = null;

        if (!$id) {
            return false;
        };
        $email = self::getOutboxEmail($id);
        if (!$email) {
            return false;
        };

        if ($email['mailfrom']) {
            $mailfrom = self::_usersToRecipients($email['mailfrom']);
        };
        $to = self::_usersToRecipients($email['recipients']);
        $cc = self::_usersToRecipients($email['ccs']);
        $bcc = self::_usersToRecipients($email['bccs']);
        if (self::_sendmail($mailfrom, $to, $cc, $bcc, $email['subject'], $email['html'], $email['files'])) {
            $db->update('emails', array('isSent' => true), 'WHERE id=?', array($id));
            $logData = array(
                'action' => 'emailed',
                'newValue' => $id
            );
            if (!$tampered) {
                $logData['userId'] = 0;
            };
            if ($email['contextType'] !== null && $email['contextId'] !== null) {
                $logData['objectType'] = $email['contextType'];
                $logData['objectId'] = $email['contextId'];
            };
            trigger('log', $logData);
            trigger('outbox_changed');
            return true;
        };

        return false;
    }