I Use the Internet Mail Suite to retreive the number of mail messages, BUT
you could alos use a simple Socket component and pass commands that way.
I THINK the list command you want is ULIST ...I Think...cant remember off
hand,
This might be the easiets and lowest overhead method of doing it IF you
dont want the hassel of mail compoents.
I.e. This is how you would go about it :-
Set the port to mail port (normally 110)
Set the mail server
(this is done on the socket component too....)
Then you want to send commands out the port via the socket componet.
Most have a "SendText" TYPE of property that you can assign text to that
will get sent.
Then you need to log on and ensure that you have looged on ok.
For this, I recomend you use something like a memo componet and assign all
incoming data from the socket to the memos lines.
Then if it has logged in, you can get a list of the emails
e.g
MySocket1.Sendtext("USER myloginname"#13) ///need to put a #13 at the
end
MySocket1.Sendtext("PASS mypassword"#13)
at this point the memo will get assorted data back, and it sould have
something like +OK xxx Octals or something of this sort.
This means you are logged in ok
now you want to get a list of the emails, but the LIST command will just
list all your emails, i.e. one after the other's contents.
The command you want is STAT
eg. MySocket1.Sendtext("STAT"#13)
This will return the number or messages are waiting, AND how big they all
are.
The way to test this is to use Telnet, this will show you want you can
expect to get back fro the socket.
Hope this is not TOO confusing, and DOES help.....
Cheers, Jeremy Coulter
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of gajo
> Sent: Saturday, September 25, 1999 9:08 PM
> To: Multiple recipients of list delphi
> Subject: [DUG]: Number of e-mails on server
>
>
> How can I retrieve the number of e-mails on my POP3 server
> (before I download them), and also, how
> can I get the total size of the e-mails?
>
> Thanks, Gajo
>
> ------------------------------------------------------------------
> ---------
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz