Главная страница
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
3-13566
Slava_BAZ
2002-07-16 11:58
2002.08.05
Функция


3-13577
AlexGreG
2002-06-27 08:34
2002.08.05
... как любимые записи зимним вечером у камина ...


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


7-13831
Ernar
2002-05-11 22:01
2002.08.05
Процессор


3-13554
MCFire
2002-07-15 10:39
2002.08.05
Как при инсталяции моей проги проинсталировать IB server???