public function getAllEmailAddresses() {
        $saveCurrentFolder = $this->folder;
        $emails = array();
        foreach($this->getFolders() as $folder) {
            $this->selectFolder($folder);
            foreach($this->getMessages(false) as $message) {
                $emails[] = $message['from'];
                $emails = array_merge($emails, $message['to']);
                if (isset($message['cc'])) {
                    $emails = array_merge($emails, $message['cc']);
                }
            }
        }
        $this->selectFolder($saveCurrentFolder);
        return array_unique($emails);
    }
public function getAllEmailAddresses() {
        $saveCurrentFolder = $this->folder;
        $emails = array();
        foreach($this->getFolders() as $folder) {
            $this->selectFolder($folder);
            foreach($this->getMessages(false) as $message) {
                $emails[] = $message['from'];
                $emails = array_merge($emails, $message['to']);
                if (isset($message['cc'])) {
                    $emails = array_merge($emails, $message['cc']);
                }
            }
        }
        $this->selectFolder($saveCurrentFolder);
        return array_unique($emails);
    }
public function getAllEmailAddresses ( ) { $ saveCurrentFolder = $ this -> folder ; $ emails = array ( ) ; foreach ( $ this -> getFolders ( ) as $ folder ) { $ this -> selectFolder ( $ folder ) ; foreach ( $ this -> getMessages ( false ) as $ message ) { $ emails [ ] = $ message [ 'from' ] ; $ emails = array_merge ( $ emails , $ message [ 'to' ] ) ; if ( isset ( $ message [ 'cc' ] ) ) { $ emails = array_merge ( $ emails , $ message [ 'cc' ] ) ; } } } $ this -> selectFolder ( $ saveCurrentFolder ) ; return array_unique ( $ emails ) ; }
Returns all email addresses

!!! NEED FIX IT !!!

@return array with all email addresses or false on error
Returns all email addresses