FetchArray()) { if ($row['saliase'] != '') { $domainList2 = explode(':', $row['saliase']); foreach ($domainList2 as $domain) { if (!in_array($domain, $domains)) { $domains[] = $domain; } } } } return $domains; } $res = $db->Query('SELECT saliase FROM {pre}gruppen WHERE saliase IS NOT NULL;'); // Get custom alias domains from groups $domains = getDomainAliasesFromQuery($res,$domains); $res = $db->Query('SELECT saliase FROM {pre}users WHERE saliase IS NOT NULL;'); // Get custom alias domains from users $domains = getDomainAliasesFromQuery($res,$domains); foreach ($domains as $domain) { echo $domain.' b1gmailtransport:dummy'."\n"; }