BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TidText + TidAttachment + stream + indy9

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Omega
Guest





PostPosted: Tue Jan 25, 2005 1:08 pm    Post subject: TidText + TidAttachment + stream + indy9 Reply with quote



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





PostPosted: Tue Jan 25, 2005 6:33 pm    Post subject: Re: TidText + TidAttachment + stream + indy9 Reply with quote




"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





PostPosted: Thu Jan 27, 2005 1:01 pm    Post subject: Re: TidText + TidAttachment + stream + indy9 Reply with 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.

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





PostPosted: Fri Jan 28, 2005 12:07 am    Post subject: Re: TidText + TidAttachment + stream + indy9 Reply with quote


"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.