PAGUE 6 MESES
LEVE 12 MESES
GARANTIR DESCONTO

Fórum Como não verificar novamente os emails e deixar marcado como não lido usando a ferramenta IDPOP3 #418782

20/06/2012

0

Galera espero que alguem ai possa me ajudar.
estou desenvolvendo um programa que verifique se o email existe anexo de *.xml.
Se existir eu baixo ele.
O meu problema está sendo o seguinte. Quando o email é verificado e baixado.
e eu faço outra verificação no email. o sistema verifica todos email novamente,
consequentemente isso cauda muita demora.

Será que tem algum jeito de marcar os email para não verificar novamente, sem
deixar o email marcado como lido?
alguem tem alguma sugestão??
Alguem sabe como pegar o id do email e armazenar?
isso me ajudaria.

Obs:( No GMAIL funcionar corretamente em outros servidores não deu certo Hotmail e WebMail, nesses dois
servidores o sistema verificou novamente todos os emails. e no servidor do Hotmail eu tenho mais de 100 mensagens
com isso demora muito.)

while not DmPan.CdsPesqEmail.Eof do
begin

POPCreat:=Nil;
POPCreat:= TIdPOP3.Create(Self);
if not POPCreat.Connected then
begin
POPCreat.Host :=DmPan.CdsPesqEmailEMA_SERVIDOR.AsString;
POPCreat.Port :=StrToInt(DmPan.CdsPesqEmailEMA_PORTA.AsString);
POPCreat.Username :=DmPan.CdsPesqEmailEMA_USUARIO.AsString;
POPCreat.Password :=DmPan.CdsPesqEmailEMA_SENHA.AsString;
POPCreat.Connect;
ShowMessage(Conectado);
end;
// testa a conexao
if not POPCreat.Connected then
Begin
ShowMessage(Conexão não realizada!);
ShowMessage(Verifique os e-mails cadastrados.);
Exit;
End;
//Pega a qtd de msg que há na caixa de entrada
iMsgs:=null;
iMsgs := POPCreat.CheckMessages;
sEmail := TStringList.Create;
lMsg := TIdMessage.Create;
lMsg.Encoding := meMIME;
//showmessage (inttostr(POPCreat.CheckMessages));
//Recebe a mensagem
for i := 1 to iMsgs do
begin
POPCreat.Retrieve(i, lMsg);
// Baixar Anexo
for j := 0 to lmsg.MessageParts.Count - 1 do
begin
parte := lmsg.MessageParts.Items[j];
{ Verifica se a parte é um anexo }
if (parte is TIdAttachmentfile) then
begin
anexo := parte as TIdAttachmentFile;
if anexo.ContentType = text/xml Then
begin
LocalXmlBaixado:=;
LocalXmlBaixado:=DmPan.CdsParametroPAR_PASTA.AsString;
Anexo.SaveToFile(LocalXmlBaixado+\+anexo.FileName);
end;
end;
end;
end;

try
finally
POPCreat.Disconnect;
lMsg.Free;
sEmail.Free;
end;
DmPan.CdsPesqEmail.Next;
end;// while


Agradeço a ajuda..
T+
Anderson Lopes

Anderson Lopes

Responder

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar