| View previous topic :: View next topic |
| Author |
Message |
Omega Guest
|
Posted: Tue Jan 25, 2005 1:08 pm Post subject: TidText + TidAttachment + stream + indy9 |
|
|
Hello,
I use POP and i want to read some mail in a mail box.
On this part i have no worries.
But when i try to save the attachement and the body in the same stream, i
can 't see the attachement after.
I did some thing like this :
procedure toto;
var
s : TStrings;
myEmail : TMyEmail;
intIndex: integer;
iProp : Integer;
i : integer;
sDir : string;
sStream : TMemoryStream;
myMsgDecoder : TIdMessageDecoder;
begin
.....
for i := 0 to msg.MessageParts.Count -1 do
begin
if msg.MessageParts.Items[i] is TIdAttachment then
begin
s := TIdAttachment(msg.MessageParts.Items[i]).Headers;
end;
if msg.MessageParts.Items[i] is TIdText then
s := TIdText(msg.MessageParts.Items[i]).Body;
end;
sStream.Position := 0;
s.SaveToStream(sStream);
end;
Thank you for your Help !
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Tue Jan 25, 2005 6:33 pm Post subject: Re: TidText + TidAttachment + stream + indy9 |
|
|
"Omega" <omega.ch (AT) bluewin (DOT) ch> wrote
| Quote: | But when i try to save the attachement and the body in the
same stream, i can 't see the attachement after.
|
It is unclear as to what exactly you are trying to accomplish in the first
place. Please elaborate.
Gambit
|
|
| Back to top |
|
 |
Omega Guest
|
Posted: Thu Jan 27, 2005 1:01 pm Post subject: Re: TidText + TidAttachment + stream + indy9 |
|
|
I connect to a mailbox with Indy pop.
When I'm connected i check if there is some mail in it.
If there is some i open the first one and after i load the message with
idMessage
When i load it i take the body and i save it in a stream but loose the
attachement.
After it i save the body in a database and create a log for your helpdesk
team.
My question : How can i but the body and the attachement on the same stream
because after it i save it in HTML mode and i do a convertion to RTF with
Word.
thank you for your help.
"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote
| Quote: |
"Omega" <omega.ch (AT) bluewin (DOT) ch> wrote in message
news:41f644b8 (AT) newsgroups (DOT) borland.com...
But when i try to save the attachement and the body in the
same stream, i can 't see the attachement after.
It is unclear as to what exactly you are trying to accomplish in the first
place. Please elaborate.
Gambit
|
|
|
| Back to top |
|
 |
Ciaran Costelloe Guest
|
Posted: Fri Jan 28, 2005 12:07 am Post subject: Re: TidText + TidAttachment + stream + indy9 |
|
|
"Omega" <omega.ch (AT) bluewin (DOT) ch> wrote
| Quote: | I connect to a mailbox with Indy pop.
When I'm connected i check if there is some mail in it.
If there is some i open the first one and after i load the message with
idMessage
When i load it i take the body and i save it in a stream but loose the
attachement.
After it i save the body in a database and create a log for your helpdesk
team.
|
The "message text" is not always in the body, it should be in the
MessageParts for a MIME message. The plain-text version (if present) is
usually in the first message part. If it is html-only, the html is usually
the first part. You may need to read up on the MIME RFCs. Alternatively,
save the complete message with TIdMessage.SaveToFile() ?
Ciaran
|
|
| Back to top |
|
 |
|