浏览代码

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

stevetruckstuff 19 年之前
父节点
当前提交
e499b62301
共有 1 个文件被更改,包括 13 次插入0 次删除
  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;
+    }
 }