Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 03-01-2005
Kamikaze Kamikaze is offline
Miembro
 
Registrado: abr 2004
Posts: 30
Poder: 0
Kamikaze Va por buen camino
Question ¿Where is the mistake?

Hola a todos, mi problema es que estoy teniendo un problemilla a la hora de
descargarme los emails y me gustaria que si alguien sabe un poco del tema
que le eche un vistazo al codigo.

Muchas gracias!!!!



Código PHP:
unit Unit1;
interface
uses
Windows
MessagesSysUtilsVariantsClassesGraphicsControlsForms,
 
DialogsIdBaseComponentIdComponentIdTCPConnectionIdTCPClient,
 
IdMessageClientIdPOP3StdCtrlsIdMessage;

type
  TForm1 
= class(TForm)
    
IdPOP31TIdPOP3;
    
IdMessage1TIdMessage;
    
Button1TButton;
    
Memo1TMemo;
    
procedure IdPOP31Connected(SenderTObject);
    
procedure Button1Click(SenderTObject);
  private
    { Private 
declarations }
  public
    { Public 
declarations }
  
end;
var
  
Form1TForm1;
implementation
{$R *.dfm}
procedure TForm1.IdPOP31Connected(SenderTObject);
begin
IdPOP31
.Host := 'pop3.terra.es';
IdPOP31.Username := 'acid_explosion.terra.es';
IdPOP31.Password := '******************'
//¿el fallo podria ser del servidor?:confused: 
end;
procedure TForm1.Button1Click(SenderTObject);
var
pop3mailcounttotalI integer;
pop3mailboxsizetotalI integer;
integer;
integer;
integer;
bodyS TStringList;
string;
MsgTIdMessage;
begin
 bodyS 
:= TStringList.Create;
 
IdPOP31.Connect;
 
pop3mailcounttotalI := IdPOP31.CheckMessages;
 
pop3mailboxsizetotalI := IdPOP31.RetrieveMailBoxSize div 1024;
 
ShowMessage'Mail total =' ' ' IntToStrpop3mailcounttotalI ) );
 
ShowMessage'Mailbox size total =' ' ' IntToStr
pop3mailboxsizetotalI ) + ' ' 'Kilobytes' );
 for 
:= 1 to pop3mailcounttotalI do begin
  ShowMessage
'I =' ' ' IntToStr) );
  
Msg :=  TIdMessage.CreateSelf );
  if 
IdPOP31.RetrieveIMsg then begin // add an IDMessage component from the Indy Misc tab, to initialize IdMessage1
   // BodyS.Clear;
   // ShowMessage( IdMessage1.MsgId );
   // ShowMessage( IdMessage1.Subject );
   
{
   for 
:= 0 to PredIdMessage1.MessageParts.Count ) do begin
    
if ( IdMessage1.MessageParts.Itemsis TIdAttachmentthen 
begin
     BodyS
.AddTIdAttachment(IdMessage1.MessageParts.Items] ).Filename );
    
end;
    if ( 
IdMessage1.MessageParts.Itemsis TIdText then begin
     ShowMessage
'I am here' );
     
BodyS.AddStringsTIdTextIdMessage1.MessageParts.Items]).Body );
     
// s := s + ' ' +  TIdText( IdMessage1.MessageParts.Items[ J ]).Body.Text;
    
end;
   
end;
   
// .Add(TmpStr + '|' + StringReplace(BodyS.Text, #13#10, '^', [rfReplaceAll]));
   //  MsgList.Add(TmpStr);
   // ShowMessage( s );
   
ShowMessageBodyS.Text );
   }
    
Msg.NoDecode := false;
    
//
    // Msg.NoDecode := true; // this does certainly not work
    //
    
BodyS.Clear;
    
// Memo1.Clear;
    
ShowMessageMsg.ContentType );
    for 
:= 0 to PredMsg.MessageParts.Count) do
    
begin
      
//general attachments
      
if ( Msg.MessageParts.Items[Jis TIdAttachment then
      begin
        
// lstAttachments.Add(TIdAttachment( Msg.MessageParts.Items [J]).Filename);
      
end
      
//body text
      
else
      
// begin
       // for K := 0 to 1 do begin
        
if Msg.MessageParts.Items[Jis TIdText then begin
         Memo1
.Lines.AddStrings(TIdTextMsg.MessageParts.Items [J]).Body);
         
BodyS.AddStringsTIdTextMsg.MessageParts.Items]).Body );
        
end;
       
//end;
      // end;
    
end;
   
ShowMessageBodyS.Text );
  
end
  
else begin
   ShowMessage
'Internet: E-mail: Header: Could not be retrieved' );
  
end;
 
end;
 
IdPOP31.Disconnect;

end;
end
P.D.: Si alguien dispone de un codigo mejor o mas elaborado que este, le
agradeceria mucho que me lo enviara.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 14:25:02.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi