M
moonbird11
Unregistered / Unconfirmed
GUEST, unregistred user!
谁有FTP上传、下载文件的例子?谁还有邮件发送和接收的例子?
给个例子也行。 E_mail: moonbird11@eyou.com
我是用D6,用的是INDY9组件,用IDPOP3,现在我不知道我接收下来的附件到那里了,如何指定下载附件到指定地方?
程序如下:请看看
procedure TForm1.N1Click(Sender: TObject);
var
intIndex:integer;
MailAttachment:TListItem;
begin
Msg.Clear ;
//清除邮件包容器
if ListView1.Items.Count >0 then
begin
IdPOP31.Retrieve(ListView1.Selected.Index+1,Msg);
//将邮件内容放入邮件包容器中
AttachmentList.Items.Clear ;
//清除附件列表
for intIndex := 0 to Pred(Msg.MessageParts.Count) do
begin
//附件
if (Msg.MessageParts.Items[intIndex] is TIdAttachment) then
begin
MailAttachment := AttachmentList.Items.Add;
MailAttachment.ImageIndex := 0;
MailAttachment.Caption := TIdAttachment(Msg.MessageParts.Items[intIndex]).Filename;
MailAttachment.SubItems.Add(TIdAttachment(Msg.MessageParts.Items[intIndex]).ContentType);
end
else
//正文
begin
if Msg.MessageParts.Items[intIndex] is TIdText then
begin
Messagememo.Lines.Clear;
Messagememo.Lines.AddStrings(TIdText(Msg.MessageParts.Items[intIndex]).Body);
end
end;
end;
end;
end;
给个例子也行。 E_mail: moonbird11@eyou.com
我是用D6,用的是INDY9组件,用IDPOP3,现在我不知道我接收下来的附件到那里了,如何指定下载附件到指定地方?
程序如下:请看看
procedure TForm1.N1Click(Sender: TObject);
var
intIndex:integer;
MailAttachment:TListItem;
begin
Msg.Clear ;
//清除邮件包容器
if ListView1.Items.Count >0 then
begin
IdPOP31.Retrieve(ListView1.Selected.Index+1,Msg);
//将邮件内容放入邮件包容器中
AttachmentList.Items.Clear ;
//清除附件列表
for intIndex := 0 to Pred(Msg.MessageParts.Count) do
begin
//附件
if (Msg.MessageParts.Items[intIndex] is TIdAttachment) then
begin
MailAttachment := AttachmentList.Items.Add;
MailAttachment.ImageIndex := 0;
MailAttachment.Caption := TIdAttachment(Msg.MessageParts.Items[intIndex]).Filename;
MailAttachment.SubItems.Add(TIdAttachment(Msg.MessageParts.Items[intIndex]).ContentType);
end
else
//正文
begin
if Msg.MessageParts.Items[intIndex] is TIdText then
begin
Messagememo.Lines.Clear;
Messagememo.Lines.AddStrings(TIdText(Msg.MessageParts.Items[intIndex]).Body);
end
end;
end;
end;
end;