我用delphi7+POP3开发邮件接收程序,不知道怎样得到每个邮件的标题。另外怎样读邮件的同时删除服务器上的备份。
解决方案 »
- 开始打捞最old的帖子了 嘿嘿
- 要将主界面分成上、左、右三块,用什么组件?panel还是frame?怎样设置panel边框的颜色?
- sql语句问题???
- 呼叫中心寻求兼职人员
- SocketConnection必须放在RemoteDataModule中才可以用么
- 编译错误,在线求救。。。。。。。。
- IdTCPClient中memorystream 的接收问题!急+郁闷!一晚上没折腾出来!
- 高分求教F1BOOK的用法。
- 小case的呀!各位同仁给点意见,关于数据库查找数据!(请进!)
- 看手帮我看看为什么在DELPHI6的环境下不正确!
- 各位帮帮我,字符转换成ASCII码的问题??
- 急!询问取得本机工作组的问题~~~
try
self.POP3GetMailInfo.Connect(5000);
self.Status.Caption:='连接服务器成功...';
mailCount:=self.POP3GetMailInfo.CheckMessages;
self.Status.Caption:='共'+inttostr(mailCount)+'封邮件';
self.POP3GetMailInfo.Disconnect;
except
self.Status.Caption:='连接服务器失败...';
end;//接收邮件
var
intIndex,j: integer;
itm: TListItem;
tempCaption,
tempSubject,
tempRetrieveMsgSize,
tempDate,
FileDate:string;
begin
lvMailBox.Items.Clear;
for intIndex := 1 to inMsgCount do
begin
self.Status.Caption:='正在接收第'+inttostr(intindex)+'封邮件,(共'+inttostr(self.mailCount)+')封邮件';
Application.ProcessMessages;
Msg.Clear;
Pop3GetmailInfo.Retrieve(IntIndex,msg); tempCaption:=Msg.From.Text;
tempSubject:=Msg.Subject;
tempRetrieveMsgSize:=IntToStr(POP3GetMailInfo.RetrieveMsgSize(intIndex));
tempDate:=formatdatetime('yyyy-mm-dd hh:mm:ss',Msg.Date);
FileDate:=formatdatetime('yyyymmddhhmmss',Msg.Date); itm := lvMailBox.Items.Add;
itm.ImageIndex := 5;
itm.SubItems.Add(tempCaption);
itm.SubItems.Add(tempSubject);
itm.SubItems.Add(tempDate);// DateToStr(Msg.Date));
itm.SubItems.Add(tempRetrieveMsgSize);
//接收附件
for j := 0 to Pred(Msg.MessageParts.Count) do
if (Msg.MessageParts.Items[j] is TIdAttachment) then
begin
tempCaption:=TIdAttachment(Msg.MessageParts.Items[j]).Filename;
TIdAttachment(Msg.MessageParts.Items[j]).SaveToFile(FAttachPath+FileDate+tempCaption);
end
else
begin
if Msg.MessageParts.Items[j] is TIdText then
begin
end
end;
//删除邮箱邮件
Pop3GetmailInfo.Delete(IntIndex);
end;
self.Status.Caption:='接收完毕,(共'+inttostr(self.mailCount)+')封邮件';