Re: imap_rfc822_parse_adrlist problem
| From: | Manuel Lemos | Date: | Sun, 21 Dec 2008 02:41:20 +0000 |
| Subject: | Re: imap_rfc822_parse_adrlist problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-284899@lists.php.net to get a copy of this message | ||
Hello,
on 12/20/2008 09:34 PM Ben Stuyts said the following:
> Hi,
>
> Since upgrading to php 5.2.8 I have a problem with
> imap_rfc822_parse_adrlist. When I run the example given on the manual
> page at http://nl3.php.net/imap_rfc822_parse_adrlist:
>
> $adds = 'ian eiloart <iane@example.ac.uk>,
> shuf6@example.ac.uk,
> blobby,
> "ian,eiloart"<ian@example.ac.uk>,
> <@example.com:foo@example.ac.uk>,
> foo@#,
> ian@-example.com,
> ian@one@two';
> $add_arr = imap_rfc822_parse_adrlist($adds, 'example.com');
> var_export ($add_arr);
>
> I should get:
> ...
> 2 =>
> class stdClass {
> var $mailbox = 'blobby';
> var $host = 'example.ac.uk';
> },
> ...
>
> but I get:
> ...
> 2 =>
> stdClass::__set_state(array(
> 'mailbox' => 'blobby',
> 'host' => 'p?a(',
> )),
> ...
>
> So the host part isn't filled in correctly. I have verified this on two
> FreeBSD 7 machines. On an older FreeBSD 5 machine with php4 this works
> fine. Before the update, I was running php 5.2.6 and there was no
> problem either. Any ideas?
Sometime ago I decided to not use IMAP library functions to parse e-mail
addresses because it was not handling all sorts of addresses as it should.
Nowadays I use an e-mail address parser class written in pure PHP that
comes with this MIME parser class:
http://www.phpclasses.org/mimeparser
--
Regards,
Manuel Lemos
Find and post PHP jobs
http://www.phpclasses.org/jobs/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/