New function to return only the email address. For use with templates.
authorstevetruckstuff <stevetruckstuff@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 6 Oct 2006 21:53:04 +0000 (21:53 +0000)
committerstevetruckstuff <stevetruckstuff@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 6 Oct 2006 21:53:04 +0000 (21:53 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11848 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/mime/AddressStructure.class.php

index 165607f70ad8d2ce6589a2977019cff844b19af5..0c0f7e1ed939d616cc1bd19e0efc1dbf669d71dd 100644 (file)
@@ -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;
+    }
 }