CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
How to list email messages?

 



yim11
Novice

Jul 14, 2000, 12:48 PM

Post #1 of 2 (321 views)
How to list email messages? Can't Post

I am looking for a way to list all the messages for a user. I have the following code that will login and save the messages to a txt file, but need to list all the messages, preferably by subject, but at this point I'll take anything I can get. Smile
TIA for any help!!!!
-Jim
---------begin code--------------
use Mail::POP3Client;

$mail =new mail::POP3Client("user", "password", "pop3.server.com");
if ($mail->Count) {
print "$mail->Count, " new messages.\n";
print "Saving messages to email.txt\n";
open FILEHANDLE, ">email.txt";
for($loop_index = 1; $loop_index <= $mail->Count; $loop_index++) {
print FILEHANDLE $mail->Body(1);
}
close FILEHANDLE;
}
------------end code-----------------


Kanji
User

Jul 14, 2000, 1:24 PM

Post #2 of 2 (321 views)
Re: How to list email messages? [In reply to] Can't Post

There is an example of doing that and more (actually, it's the only example!) in the Mail::POP3Client documentation.

Anyhoo, just replace ^(From|Subject): in the example to ^Subject: to get just the subject.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives