You are here: Re: get all the email addresses from a text file « PHP Programming Language « IT news, forums, messages
Re: get all the email addresses from a text file

Posted by ZeldorBlat on 03/22/06 20:37

Nico wrote:
> "ZeldorBlat" <zeldorblat@gmail.com> a écrit dans le message de news:
> 1143047047.293959.114180@g10g2000cwb.googlegroups.com...
>
> > What does the .txt file look like? (Please don't say HTML)
>
>
> Well it looks like that :
>
>
> Email : bois.massif@wanadoo.fr
> Errors : 3
> Reason : 550 <bois.massif@wanadoo.fr>: Recipient address rejected: User
> unknown
>
> Email : subaruclamp@aol.com
> Errors : 2
> Reason : 550 <subaruclamp@aol.com>... User unknown
>
> Email : sylvie.ravise@infonie.fr
> Errors : 64
> Reason : 552 RCPT TO:<sylvie.ravise@infonie.fr> Mailbox disk quota exceeded
>
> Email : c.sibe@cario.fr
> Errors : 2
> Reason : 550 <c.sibe@cario.fr> ... recipient rejected
>
> Email : hohiojijoioh@club-internet.fr
> Errors : 8
> Reason : 550 <hohiojijoioh@club-internet.fr>: Recipient address rejected:
> User unknown in local recipient table

If you're confident about the format of the file, you can just do
something like this:

$fn = 'myfile.php';
$lines = file($fn);

$badAddresses = array();

foreach($lines as $line)
if(strpos($line, 'Email : ') === 0)
$badAddresses[] = substr($line, 8);

Of course that isn't very forgiving if one of the lines looks
different, but it should work nonetheless.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация