1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace ICanBoogie\Mailer;
13
14 15 16
17 class extends AddressList
18 {
19 public function __toString()
20 {
21 $rc = '';
22
23 foreach ($this->address_list as $mailbox => $display_name)
24 {
25 if ($rc)
26 {
27 $rc .= "\r\n\t";
28 }
29
30 if ($display_name === true)
31 {
32 $rc .= $mailbox;
33
34 continue;
35 }
36
37 if (!mb_check_encoding($display_name, 'ASCII'))
38 {
39 $display_name = mb_encode_mimeheader($display_name);
40 }
41 else
42 {
43 $display_name = self::escape_display_name($display_name);
44 }
45
46 $rc .= "$display_name <$mailbox>";
47 }
48
49 return $rc;
50 }
51 }