Browse Source

New function to return only the email address. For use with templates.

stevetruckstuff 19 năm trước cách đây
mục cha
commit
e499b62301
1 tập tin đã thay đổi với 13 bổ sung0 xóa
  1. 13 0
      class/mime/AddressStructure.class.php

+ 13 - 0
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;
+    }
 }