i'm using C++ builder 6 and Indy 9/10. I'm coding to receive certified emails with attachments (basically pdf and xml files). When i receive the email, it have a TidMessageParts with one multipart/mixed part and others parts for a small text, an xml attachment with info about the certification of the email and parts for digital signature and more. My problem is: how to open the first part (multipart/mixed) to extract text and attachment in it.
See the answer i'll post.
Thank you. Fabrizio
TIdMessagePartis aTCollectionItemdescendant. TheTCollectionItem::Collectionproperty points to the owning (parent)TCollection, not to some inner collection, like you are expecting 1. That is whymp1andmpare pointing at the same address in memory.You don't "open a message part" in Indy. You simply iterate the
TIdMessage::MessagePartscollection from one end to the other until you find the particular part you are interested in, such as by looking at their class type,ContentTypeproperties, etc. For example:1: support for inner nested collections has not been implemented yet, not even in Indy 10. It won't be implemented until Indy 12 at the earliest.