protected function toAddress($headerinfos) {
        $email = "";
        $name = "";
        if (isset($headerinfos->mailbox) && isset($headerinfos->host)) {
            $email = $headerinfos->mailbox . "@" . $headerinfos->host;
        }

        if (!empty($headerinfos->personal)) {
            $name = imap_mime_header_decode($headerinfos->personal);
            $name = $name[0]->text;
        } else {
            $name = $email;
        }

        $name = $this->convertToUtf8($name);

        return $name . " <" . $email . ">";
    }
protected function toAddress($headerinfos) {
        $email = "";
        $name = "";
        if (isset($headerinfos->mailbox) && isset($headerinfos->host)) {
            $email = $headerinfos->mailbox . "@" . $headerinfos->host;
        }

        if (!empty($headerinfos->personal)) {
            $name = imap_mime_header_decode($headerinfos->personal);
            $name = $name[0]->text;
        } else {
            $name = $email;
        }

        $name = $this->convertToUtf8($name);

        return $name . " <" . $email . ">";
    }
protected function toAddress ( $ headerinfos ) { $ email = "" ; $ name = "" ; if ( isset ( $ headerinfos -> mailbox ) && isset ( $ headerinfos -> host ) ) { $ email = $ headerinfos -> mailbox . "@" . $ headerinfos -> host ; } if ( ! empty ( $ headerinfos -> personal ) ) { $ name = imap_mime_header_decode ( $ headerinfos -> personal ) ; $ name = $ name [ 0 ] -> text ; } else { $ name = $ email ; } $ name = $ this -> convertToUtf8 ( $ name ) ; return $ name . " <" . $ email . ">" ; }
Convert imap given address into string

@param object $headerinfos the infos given by imap
@return string in format "Name <email@bla.de>"
Convert imap given address into string