Вниз
Скачать: CL | DM;

Indy Pop3   Найти похожие ветки 

 
Dup   (2002-05-08 08:50) [0]

Что-то не получается вытащить вложенный файл из сообщения

var hd:TIdMessage;
att:TIdAttachment;
begin
hd:=TIdMessage.Create(nil);
if IdPOP31.Retrieve(1,hd);
att:=TIdAttachment.Create(hd.MessageParts);
att.SaveToFile("33.txt");

Может кто знает как это делается?


 
Rever   (2002-05-23 14:57) [1]

Я так делаю:

MsgRcv := TIdMessage.Create(self);
MsgRcv.NoDecode := false;
POP3Cl.Retrieve(1, MsgRcv)
for i := 0 to MsgRcv.MessageParts.Count-1 do begin
if MsgRcv.MessageParts.Items[i] is TIdAttachment then begin
fname := (AMsg.MessageParts.Items[i] as TIdAttachment).FileName;
TIdAttachment(AMsg.MessageParts.Items[i]).SaveToFile(tmpname);
end else
if AMsg.MessageParts.Items[i] is TIdText then begin
fst := TMemoryStream.Create;
TIdText(AMsg.MessageParts.Items[i]).Body.SaveToStream(fst);
fst.Position := 0;
//Далее загрушаешь из потока текст куда надо
edtMemo.LoadFromStream(fst);
fst.Free;
end
POP3Cl.Delete(1);
fname, tmpname - переменные из моей проги, edtMemo - MemoEdit.



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.009 c
8-13722
F-Nick
2002-03-27 12:58
2002.08.05
Компоненты и графика


1-13607
Filat
2002-07-24 16:22
2002.08.05
Сканирование каталогов In & Out + перемещение файлов по ф6?


1-13657
Sub
2002-07-23 14:55
2002.08.05
Общие вопросы


1-13646
Kudatsky
2002-07-22 10:13
2002.08.05
Delphi 5 не реагирует на ошибки с плавающей точкой


7-13835
Chief
2002-05-22 09:24
2002.08.05
Набор телефонного номера




   Наверх