ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilMailPearRfc822WrapperAddressParser.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Services/Mail/classes/Address/Parser/class.ilBaseMailRfc822AddressParser.php';
5 
11 {
15  public function parseAddressString($a_addresses)
16  {
17  if(strlen($a_addresses) == 0)
18  {
19  return array();
20  }
21 
22  require_once 'Services/Mail/classes/class.ilMail.php';
23  require_once 'Services/Mail/classes/Address/Parser/RFC822.php';
24  $parser = new Mail_RFC822();
25  $parsed_addresses = $parser->parseAddressList($a_addresses, ilMail::ILIAS_HOST, false, true);
26 
27  require_once 'Services/Mail/classes/Address/class.ilMailAddress.php';
28  return array_map(function($address) {
29  return new ilMailAddress($address->mailbox, $address->host);
30  }, $parsed_addresses);
31  }
32 }
const ILIAS_HOST
Class ilBaseMailRfc822AddressParser.
Create styles array
The data for the language used.
$parser
Definition: BPMN2Parser.php:24
Class ilMailAddress.