BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Weird TIDPop3 behaviour

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
xxx
Guest





PostPosted: Thu Nov 27, 2003 9:01 am    Post subject: Weird TIDPop3 behaviour Reply with quote



Hi,

the code below generates an 'unknown header' exception:

---------------------------------------------------------------------------
var
sock :TIDPop3;
intMsgCount,x : Integer;
theMsg : TIdMessage;
begin
(...)

intMsgcount := sock.CheckMessages();
for x := 0 to intMsgCount do
begin
(...) //init of theMsg etc
sock.RetrieveMsg(x,theMsg); //Here i get a 'Unknown POP3 header'
exception
end;
(...)

---------------------------------------------------------------------------

the following code works perfectly:

---------------------------------------------------------------------------
var
sock :TIDPop3;
intMsgCount,intMsgSize,x : Integer;
theMsg : TIdMessage;
begin
(...)

intMsgcount := sock.CheckMessages();
for x := 0 to intMsgCount do
begin
(...) //init of theMsg etc
intMsgSize := sock.RetrieveMsgSize(x);
sock.RetrieveMsg(x,theMsg); //no error at all
end;
(...)

---------------------------------------------------------------------------


Why does RetrieveMsg fails if you don't call RetrieveMsgSize first? Is
this by design? I think it wouldn't be a problem at all, looking at
the POP3 protocol itself.
Note that this example is written straight from the head, in my real
code I check if the message is smaller than 6 kb, if not, it won't be
downloaden. (if intMsgSize < (1024*6) then ....)

Greetings,

ED
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.