|
Posted by odhiseo on April 12, 2007, 9:55 pm
Please log in for more thread options
>
>
>
>
>
> > > I`m using POP3Client,
> > > I don`t need to print all subject i need to print just number.
> > > i.e --> if Subject: John 1234567890, Then i need to print 1234567890
>
> > I don't understand - there is usually *no* number associated with the
> > Subject. At least that's the way it is for me when I run the script you
> > provided. Typical output is:
>
> > ----------
> > Subject: Decimal arithmetic
> > ----------
>
> > The only time I see numbers is when the person writing the email has
> > included numeric character(s) in the subject. eg:
>
> > ----------
> > Subject: [Mingw-users] mingw with g++ 4.x
> > ----------
>
> > Cheers,
> > Rob
>
> Maybe you want the Message-ID:
>
> use Mail::POP3Client;
>
> $pop = new Mail::POP3Client( USER => "xxxxxxxxxxxxxxxxx",
> PASSWORD => "xxxxxxxxxx",
> HOST => "xxxxxxxxxx" );
>
> for ($i = 1; $i <= $pop->Count(); $i++) {
> foreach ( $pop->Head( $i ) ) {
> /^(Message-ID):\s+/i && print $_, "\n";
> }
> print "\n";
> sleep 5;
> }
Sorry, now I understood your question
use Mail::POP3Client;
$pop = new Mail::POP3Client( USER => "xxxxxxxxxxxxxxxxx",
PASSWORD => "xxxxxxxxxx",
HOST => "xxxxxxxxxx" );
for ($i = 1; $i <= $pop->Count(); $i++) {
foreach ( $pop->Head( $i ) ) {
/^Subject:\.+\s(\d+)/i && print $1, "\n";
}
print "\n";
sleep 5;
}
|