From 079f3e124309cf0bb11a3a894d61842b566eddff Mon Sep 17 00:00:00 2001 From: stevetruckstuff Date: Fri, 6 Oct 2006 21:53:04 +0000 Subject: [PATCH] New function to return only the email address. For use with templates. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11848 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- class/mime/AddressStructure.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/class/mime/AddressStructure.class.php b/class/mime/AddressStructure.class.php index 165607f7..0c0f7e1e 100644 --- a/class/mime/AddressStructure.class.php +++ b/class/mime/AddressStructure.class.php @@ -97,4 +97,17 @@ class AddressStructure { 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; + } } -- 2.25.1