public function getCount($folder = null){

        if ($folder) {
            $conn = $this->getFolder($folder);
        } else {
            $conn = $this->conn;
        }

        return imap_num_msg($conn);
    }