1382493124a76dfaee676735c6d362b755491482
4 * AddressStructure.class.php
6 * Copyright (c) 2003 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 * This contains functions needed to handle mime messages.
14 class AddressStructure
{
21 function getAddress($full = true, $encoded = false) {
24 if (is_object($this)) {
25 $email = ($this->host ?
$this->mailbox
.'@'.$this->host
27 $personal = trim($this->personal
);
30 $personal_encoded = encodeHeader($personal);
31 if ($personal !== $personal_encoded) {
32 $personal = $personal_encoded;
34 $personal = '"'.$this->personal
.'"';
37 $personal = '"'.$this->personal
.'"';
39 $addr = ($email ?
$personal . ' <' .$email.'>'
41 $best_dpl = $this->personal
;
46 $result = ($full ?
$addr : $best_dpl);
51 function getEncodedAddress() {
52 return $this->getAddress(true, true);