Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

Colaboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 19-10-2016
Avatar de epuigdef
epuigdef epuigdef is offline
Miembro
 
Registrado: jul 2005
Posts: 196
Poder: 21
epuigdef Va por buen camino
gmail e IMAP

Hola:

Simplificando, éste es el código que tengo:

Código Delphi [-]
function GetGmailMessageCount(const UserName, Password: string): Integer;
var
  IMAPClient: TIdIMAP4;
  OpenSSLHandler: TIdSSLIOHandlerSocketOpenSSL;
begin
  Result := 0;
  IMAPClient := TIdIMAP4.Create(nil);
  try
    OpenSSLHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
    try
      OpenSSLHandler.SSLOptions.Method := sslvSSLv3;
      IMAPClient.IOHandler := OpenSSLHandler;
      IMAPClient.Host := 'imap.gmail.com';
      IMAPClient.Port := 993;
      IMAPClient.UseTLS := utUseImplicitTLS;
      IMAPClient.Username := UserName;
      IMAPClient.Password := Password;
      IMAPClient.Connect;
      try
        if IMAPClient.SelectMailBox('INBOX') then
          Result := IMAPClient.MailBox.TotalMsgs;
      finally
        IMAPClient.Disconnect;
      end;
    finally
      OpenSSLHandler.Free;
    end;
  finally
    IMAPClient.Free;
  end;
end;

Responder Con Cita
 



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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
delphi imap gmail obtener mails no leidos, mas recientes, por fecha JXJ Varios 1 05-02-2014 04:51:50
Sobre error para enviar email por gmail lduron Varios 8 23-11-2011 00:19:31
Imap de indy + gmail Enan0 Internet 0 10-02-2010 08:35:02
Imap LiAnTe- Varios 1 03-01-2008 22:02:17
Problemas con IMAP albertoP PHP 1 15-10-2006 00:06:15


La franja horaria es GMT +2. Ahora son las 20:30:58.


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