+ // looks up aliases in the addressbook and expands them to
+ // the full address.
+ function expandAddrs ($array) {
+ $abook = addressbook_init();
+ for ($i=0; $i < count($array); $i++) {
+ $result = $abook->lookup($array[$i]);
+ $ret = "";
+ if (isset($result['email'])) {
+ if (isset($result['name'])) {
+ $ret = '"'.$result['name'].'" ';
+ }
+ $ret .= '<'.$result['email'].'>';
+ $array[$i] = $ret;
+ }
+ else
+ {
+ $array[$i] = '<' . $array[$i] . '>';
+ }
+ }
+ return $array;
+ }
+