Discussion:
Boundary property unknown
(too old to reply)
Uli Becker
2008-07-09 15:48:43 UTC
Permalink
Hi,

I want to read the boundary property of a messagepart like this:
idMessage.messageparts[index].boundary.

Although I found many samples with this code, and it's also in the helpfile,
the property boundary is unknown. (Latest Indy snapshot and Delphi 2007).

What am I doing wrong?

Thanks. Uli
Remy Lebeau (TeamB)
2008-07-09 19:08:20 UTC
Permalink
Post by Uli Becker
idMessage.messageparts[index].boundary.
TIdMessagePart in Indy 10 does not have a Boundary property.
Post by Uli Becker
Although I found many samples with this code, and it's also in
the helpfile, the property boundary is unknown. (Latest Indy
snapshot and Delphi 2007).
You must be looking at Indy 9 examples and documentation, as TIdMessagePart
in Indy 9 did have a Boundary property.


Gambit
Uli Becker
2008-07-10 05:58:13 UTC
Permalink
Post by Remy Lebeau (TeamB)
TIdMessagePart in Indy 10 does not have a Boundary property.
You must be looking at Indy 9 examples and documentation, as
TIdMessagePart
in Indy 9 did have a Boundary property.
No, it's in the version10 help-file:

Indy10.chm

Internet Direct (Indy)

TIdMessagePart.Boundary Property
TIdMessagePart Class | TIdMessagePart Members

Anyway: is there anything that replaced the property? IOW: how can I get the
corresponding boundary of a messagepart?

Thanks. Uli
Remy Lebeau (TeamB)
2008-07-10 08:12:52 UTC
Permalink
Then the help file is wrong.
Post by Uli Becker
Anyway: is there anything that replaced the property?
IOW: how can I get the corresponding boundary of a
messagepart?
You don't. Why do you need it?


Gambit
Uli Becker
2008-07-10 10:16:52 UTC
Permalink
Remy,
Post by Remy Lebeau (TeamB)
Post by Uli Becker
Anyway: is there anything that replaced the property?
IOW: how can I get the corresponding boundary of a
messagepart?
You don't. Why do you need it?
What I want is to save a message WITHOUT attachments and then save the
attachments separately in a database. That's necessary because of a slow
network and large attachments in a special environment.
Since I am displaying the mails saved as .eml files in a TWebbrowser, I need
a working .eml file, not only the headers and bodytext.

Since the boundaries are needed for the .eml file, I tried to extract them.

Maybe it would be easier to leave the message as it is, but cut off the
attachments from it.

Regards Uli
Remy Lebeau (TeamB)
2008-07-10 17:16:32 UTC
Permalink
Post by Uli Becker
What I want is to save a message WITHOUT attachments and
then save the attachments separately in a database.
Have you tried simply removing the attachment objects from the MessageParts
collection and then re-save the message? New boundaries should be
generated.


Gambit
Uli Becker
2008-07-10 20:27:44 UTC
Permalink
Remy,
Post by Remy Lebeau (TeamB)
Have you tried simply removing the attachment objects from the
MessageParts collection and then re-save the message? New boundaries
should be generated.
Could you explain that further, please? You mean I can remove the complete
attachment MessageParts from the message and then resave it? That would
really be a solution. But I don't see, how.
Please give me a snippet of code.

Thanks. Uli
Remy Lebeau (TeamB)
2008-07-11 01:26:51 UTC
Permalink
Post by Uli Becker
Could you explain that further, please? You mean I can remove
the complete attachment MessageParts from the message and then
resave it?
Do not try to free/remove the MessageParts collection itself. Simply loop
through the collection calling Free() on each TIdAttachment object that you
find.


Gambit
Uli Becker
2008-07-11 07:29:48 UTC
Permalink
Remy,
Post by Remy Lebeau (TeamB)
Do not try to free/remove the MessageParts collection itself. Simply loop
through the collection calling Free() on each TIdAttachment object that
you find.
Wow, that works great!
Thanks a lot for this advice. Problem solved.

(Didn't suppose that it might be that simple :)

Regards Uli

Loading...