Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.08.05;
Скачать: 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 вся ветка

Текущий архив: 2002.08.05;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.012 c
1-13624
Толстый
2002-07-25 10:55
2002.08.05
Выход из Windows


14-13800
T2
2002-07-10 15:30
2002.08.05
сСылки


14-13817
НАРИК
2002-07-10 06:25
2002.08.05
информация


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


4-13852
roadstar
2002-05-29 14:24
2002.08.05
Как програмно открыть папку