From: Lubos D. <du...@gm...> - 2005-08-25 08:00:48
|
hi, i'm trying to retrieve some emails from my isp provider (gmx.de). when there are more emails (2 for example), i allways get "Connection reset by peer" error message after second tpop3send.retr command and the first email stays on the server! i can reproduce it, but no idea, how to fix it. may be a "provider bug"??? it's very strange , because no email can be deleted (even when i get ok after tpop3send.dele) ... example of my source code (of course, there is much more code there ...): LPopClient:= TPOP3Send.Create; try LPopClient.TargetHost:= 'pop.gmx.de'; LPopClient.TargetPort:= '110'; LPopClient.Username:= user_name; LPopClient.Password:= user_password; LPopClient.Timeout:= 60000; if ( LPopClient.Login ) then begin if ( LPopClient.Stat ) then begin LCount:= LPopClient.StatCount; for j:= 1 to LCount do begin if ( LPopClient.Retr(j) ) then begin // Connection reset by peer!!! LSmtpClient:= TSMTPSend.Create; try LSmtpClient.TargetHost:= '127.0.0.1'; LSmtpClient.TargetPort:= '25'; LSmtpClient.Timeout:= 60000; if ( LSmtpClient.Login ) then begin LSmtpClient.Reset; if ( LSmtpClient.MailFrom(mail_from_address, 0) ) then begin if ( LSmtpClient.MailTo(mail_to_address) ) then begin if ( LPopClient.Dele(j) ) then ; end; end; end; finally FreeAndNil(LSmtpClient); end; end; end; end; end; finally FreeAndNil(LPopClient); end; -- Lubos Dusanic IT Consultant Software Engineer |