host ? $this->mailbox.'@'.$this->host : $this->mailbox); $personal = trim($this->personal); $is_encoded = false; if (preg_match('/(=\?([^?]*)\?(Q|B)\?([^?]*)\?=)(.*)/i',$personal,$reg)) { $is_encoded = true; } if ($personal) { if ($encoded && !$is_encoded) { $personal_encoded = encodeHeader($personal); if ($personal !== $personal_encoded) { $personal = '"' . $personal_encoded . '"'; } else { $personal = '"' . $this->personal . '"'; } } else { if (!$is_encoded) { $personal = '"' . $this->personal . '"'; } } $addr = ($email ? $personal . ' <' .$email.'>' : $this->personal); $best_dpl = $this->personal; } else { $addr = $email; $best_dpl = $email; } $result = ($full ? $addr : $best_dpl); } return $result; } /** * Shorter version of getAddress() function * Returns full encoded address. * @return string * @since 1.4.0 */ function getEncodedAddress() { return $this->getAddress(true, true); } /** * Return just the email portion of this address * @return string * @since 1.5.2 */ function getEmail () { $r = ''; if (is_object($this)) { $r = $this->host ? $this->mailbox.'@'.$this->host : $this->mailbox; } return $r; } }