我用delphi7+POP3开发邮件接收程序,不知道怎样得到每个邮件的标题。另外怎样读邮件的同时删除服务器上的备份。
解决方案 »
- Strings.ValueFromIndex[i-1]在Delphi6里怎么写
- 让程序最小化时看不到程序,然后用快捷方式调出来这个要怎么做呢?
- 急救,在QReport报表中怎样在符合条件的项目后打上“*”号
- 麻烦大家推荐一个比较好用的 Socket 类。要免费的。 客户端的就行了。
- 程序员的心路历程 李维读“>”有感。
- 关于TTreeView和节点动作的问题?
- Win2000问题。急!急!!急!!!
- 救命啊!文件下载的一个菜鸟问题!来者有分!
- 请问何处有关于音频压缩格式的文档?
- 两台远程计算机通过一对MODEM连接进行数据发送(.TXT文件)发收两端的程序该如何设计?
- 各位帮帮我,字符转换成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)+')封邮件';