Z
zpselect
Unregistered / Unconfirmed
GUEST, unregistred user!
我现在用IdPOP,IdMessage来接收邮件,能成功收发邮件,但我只需收发未查看的邮件,历史邮件不需要收发,请问怎么设置?源码如下:
procedure TfrmNewMail.Btn_RecvClick(Sender: TObject);
var
i:byte;
begin
POP.Host:='pop.163.com'
POP.Port:=110;
POP.Username:='zpselect'
POP.Password:='*****';
try
try
POP.Connect();
for i:=0 to POP.CheckMessages-1 do
begin
IdMessage.Clear;
POP.Retrieve(i,IdMessage);
edtTitle.Text:=IdMessage.Subject;
M_content.Lines.Assign(IdMessage.Body);
end;
ShowMessage('共接收:'+inttostr(POP.CheckMessages)+'封邮件');
finally
POP.Disconnect;
end;
Except
messagedlg('接收失败,请检查!', mtInformation, [mbok], 0);
Exit;
end;
end;
procedure TfrmNewMail.Btn_RecvClick(Sender: TObject);
var
i:byte;
begin
POP.Host:='pop.163.com'
POP.Port:=110;
POP.Username:='zpselect'
POP.Password:='*****';
try
try
POP.Connect();
for i:=0 to POP.CheckMessages-1 do
begin
IdMessage.Clear;
POP.Retrieve(i,IdMessage);
edtTitle.Text:=IdMessage.Subject;
M_content.Lines.Assign(IdMessage.Body);
end;
ShowMessage('共接收:'+inttostr(POP.CheckMessages)+'封邮件');
finally
POP.Disconnect;
end;
Except
messagedlg('接收失败,请检查!', mtInformation, [mbok], 0);
Exit;
end;
end;