Главная страница
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.009 c
4-13866
Леонид
2002-05-02 20:44
2002.08.05
перехват сообщения WM_SPOOLERSTATUS


1-13700
propeller
2002-07-22 23:53
2002.08.05
формы отдельными задачами на taskbar е


1-13621
maxim2
2002-07-25 09:28
2002.08.05
Как получить из компонента MonthCalendar выбранную дату ...


1-13663
AlekseyK
2002-07-23 15:36
2002.08.05
Как получить только имя файла у OpenDialog


1-13694
Victor12345
2002-07-24 00:02
2002.08.05
Элементы одной формы управляют элементами другой.