C++ Builder - Indy - Receiving certified emails










-1















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










share|improve this question




























    -1















    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










    share|improve this question


























      -1












      -1








      -1








      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










      share|improve this question
















      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







      email c++builder indy10 indy-9






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 15 '18 at 13:09







      Fabrizio

















      asked Nov 5 '18 at 11:58









      FabrizioFabrizio

      12




      12






















          2 Answers
          2






          active

          oldest

          votes


















          0














          TIdMessagePart is a TCollectionItem descendant. The TCollectionItem::Collection property points to the owning (parent) TCollection, not to some inner collection, like you are expecting 1. That is why mp1 and mp are pointing at the same address in memory.



          You don't "open a message part" in Indy. You simply iterate the TIdMessage::MessageParts collection from one end to the other until you find the particular part you are interested in, such as by looking at their class type, ContentType properties, etc. For example:



          TIdMessageParts *mp = MailMessage->MessageParts; 

          for (int i = mp->Count-1; i > 0; --i)

          TIdMessagePart *part = mp->Items[i];

          if ((TIdAttachment *att = dynamic_cast<TIdAttachment*>(part)) != NULL)

          ...

          else if ((TIdText *txt = dynamic_cast<TIdText*>(part)) != NULL)

          if (txt->ContentType = "text/xml")

          ...

          else if (txt->ContentType = "text/plain")

          ...





          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.






          share|improve this answer























          • Inspetting the classname of the two first parts i have seen they are TIdText parts so i inspected them: Part #: 0 - ClassName: TIdText ContentType: multipart/mixed; boundary="----------=_1540469045-26964-21506" Part #: 1 - ClassName: TIdText ContentType: multipart/alternative; boundary="----------=_1540469045-26964-21507" Part #: 2 - ClassName: TIdText ContentType: text/plain; charset="iso-8859-1" Correct test and parts 3 to the end are correct. Parts #0 #1 body properties are empty. They have boundaries so contents are present. A solution to extract the data i need? Thanks

            – Fabrizio
            Nov 5 '18 at 18:08












          • I already gave you the solution in my answer. You can simply ignore the two multipart/... parts while iterating the collection. They are supposed to have empty bodies. Note that Indy 9 really does NOT handle MIME very well, especially multiple levels of nesting. Indy 10 does a better job at that (it has a TIdMessagePart::ParentPart` to handle nesting - Indy 12 will (hopefully) do an even better job of handling nesting). You really shouldn't be using Indy 9 anyway, it is very outdated by modern standards. Is there a reason why you have not upgraded to Indy 10 yet? It still supports BCB6.

            – Remy Lebeau
            Nov 5 '18 at 19:29












          • I can't ignore them because the contents i need are in these parts and scanning all parts i can't find them. I haven't upgraded as v 9 has the funciontions i have needed until now. Thanks for answer Remy.

            – Fabrizio
            Nov 6 '18 at 10:31












          • @Fabrizio yes, you can ignore the multipart parts, because Indy parses them by creating a collection item for each multipart header set, but does not store their content in the same collection items. The content is parsed and separated into additional collection items as needed. And v10 has everything that v9 has, but it also supports things that v9 doesn't, like Unicode, and adequate MIME handling especially for multi-level nesting of parts. v9 simply can't handle modern emails that are beyond the simplest of complexity. v10 can handle them better. You really should upgrade.

            – Remy Lebeau
            Nov 6 '18 at 16:22











          • i have tested with indy 10 but the result is the same. A suspect: in a part of the email there is written: 'this is an s/mime email" But does indy manage s/mime email? I suspect NO, so in wich manner i can read and import data from a such email? Thank You, Fabrizio

            – Fabrizio
            Nov 13 '18 at 18:31



















          0














          The answer to the problem i posted:
          @Remy told me a right observation i was unable to understand well: "The content is parsed and separated into additional collection items as needed."
          The email i'm reading is a 'certified email' so the real email is the attachment with .eml extension that indy where reading and i ignored (my email client shows the attachments in the contained email joined with the attachments of the base email).
          So, when i have right understood the Remy words and realized where to search the attachments:



          1. i have estracted the .eml file to a folder

          2. added a new TIdMessage component on the form (called PartMessage);

          3. used LoadFromFile method to read the stored file
            and now in PartMessage all attachments are visible and i was able to save them as files.

          Thanks again to Remy as his words that where preciouses to reach the solution.



          P.S. The solution works fine for Indy 9 and 10 with necessary adjustments due to different versions.
          P.P.S. i don't know why during my tests i found the text that the email was s/mime encoded as it is not.






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53153989%2fc-builder-indy-receiving-certified-emails%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            TIdMessagePart is a TCollectionItem descendant. The TCollectionItem::Collection property points to the owning (parent) TCollection, not to some inner collection, like you are expecting 1. That is why mp1 and mp are pointing at the same address in memory.



            You don't "open a message part" in Indy. You simply iterate the TIdMessage::MessageParts collection from one end to the other until you find the particular part you are interested in, such as by looking at their class type, ContentType properties, etc. For example:



            TIdMessageParts *mp = MailMessage->MessageParts; 

            for (int i = mp->Count-1; i > 0; --i)

            TIdMessagePart *part = mp->Items[i];

            if ((TIdAttachment *att = dynamic_cast<TIdAttachment*>(part)) != NULL)

            ...

            else if ((TIdText *txt = dynamic_cast<TIdText*>(part)) != NULL)

            if (txt->ContentType = "text/xml")

            ...

            else if (txt->ContentType = "text/plain")

            ...





            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.






            share|improve this answer























            • Inspetting the classname of the two first parts i have seen they are TIdText parts so i inspected them: Part #: 0 - ClassName: TIdText ContentType: multipart/mixed; boundary="----------=_1540469045-26964-21506" Part #: 1 - ClassName: TIdText ContentType: multipart/alternative; boundary="----------=_1540469045-26964-21507" Part #: 2 - ClassName: TIdText ContentType: text/plain; charset="iso-8859-1" Correct test and parts 3 to the end are correct. Parts #0 #1 body properties are empty. They have boundaries so contents are present. A solution to extract the data i need? Thanks

              – Fabrizio
              Nov 5 '18 at 18:08












            • I already gave you the solution in my answer. You can simply ignore the two multipart/... parts while iterating the collection. They are supposed to have empty bodies. Note that Indy 9 really does NOT handle MIME very well, especially multiple levels of nesting. Indy 10 does a better job at that (it has a TIdMessagePart::ParentPart` to handle nesting - Indy 12 will (hopefully) do an even better job of handling nesting). You really shouldn't be using Indy 9 anyway, it is very outdated by modern standards. Is there a reason why you have not upgraded to Indy 10 yet? It still supports BCB6.

              – Remy Lebeau
              Nov 5 '18 at 19:29












            • I can't ignore them because the contents i need are in these parts and scanning all parts i can't find them. I haven't upgraded as v 9 has the funciontions i have needed until now. Thanks for answer Remy.

              – Fabrizio
              Nov 6 '18 at 10:31












            • @Fabrizio yes, you can ignore the multipart parts, because Indy parses them by creating a collection item for each multipart header set, but does not store their content in the same collection items. The content is parsed and separated into additional collection items as needed. And v10 has everything that v9 has, but it also supports things that v9 doesn't, like Unicode, and adequate MIME handling especially for multi-level nesting of parts. v9 simply can't handle modern emails that are beyond the simplest of complexity. v10 can handle them better. You really should upgrade.

              – Remy Lebeau
              Nov 6 '18 at 16:22











            • i have tested with indy 10 but the result is the same. A suspect: in a part of the email there is written: 'this is an s/mime email" But does indy manage s/mime email? I suspect NO, so in wich manner i can read and import data from a such email? Thank You, Fabrizio

              – Fabrizio
              Nov 13 '18 at 18:31
















            0














            TIdMessagePart is a TCollectionItem descendant. The TCollectionItem::Collection property points to the owning (parent) TCollection, not to some inner collection, like you are expecting 1. That is why mp1 and mp are pointing at the same address in memory.



            You don't "open a message part" in Indy. You simply iterate the TIdMessage::MessageParts collection from one end to the other until you find the particular part you are interested in, such as by looking at their class type, ContentType properties, etc. For example:



            TIdMessageParts *mp = MailMessage->MessageParts; 

            for (int i = mp->Count-1; i > 0; --i)

            TIdMessagePart *part = mp->Items[i];

            if ((TIdAttachment *att = dynamic_cast<TIdAttachment*>(part)) != NULL)

            ...

            else if ((TIdText *txt = dynamic_cast<TIdText*>(part)) != NULL)

            if (txt->ContentType = "text/xml")

            ...

            else if (txt->ContentType = "text/plain")

            ...





            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.






            share|improve this answer























            • Inspetting the classname of the two first parts i have seen they are TIdText parts so i inspected them: Part #: 0 - ClassName: TIdText ContentType: multipart/mixed; boundary="----------=_1540469045-26964-21506" Part #: 1 - ClassName: TIdText ContentType: multipart/alternative; boundary="----------=_1540469045-26964-21507" Part #: 2 - ClassName: TIdText ContentType: text/plain; charset="iso-8859-1" Correct test and parts 3 to the end are correct. Parts #0 #1 body properties are empty. They have boundaries so contents are present. A solution to extract the data i need? Thanks

              – Fabrizio
              Nov 5 '18 at 18:08












            • I already gave you the solution in my answer. You can simply ignore the two multipart/... parts while iterating the collection. They are supposed to have empty bodies. Note that Indy 9 really does NOT handle MIME very well, especially multiple levels of nesting. Indy 10 does a better job at that (it has a TIdMessagePart::ParentPart` to handle nesting - Indy 12 will (hopefully) do an even better job of handling nesting). You really shouldn't be using Indy 9 anyway, it is very outdated by modern standards. Is there a reason why you have not upgraded to Indy 10 yet? It still supports BCB6.

              – Remy Lebeau
              Nov 5 '18 at 19:29












            • I can't ignore them because the contents i need are in these parts and scanning all parts i can't find them. I haven't upgraded as v 9 has the funciontions i have needed until now. Thanks for answer Remy.

              – Fabrizio
              Nov 6 '18 at 10:31












            • @Fabrizio yes, you can ignore the multipart parts, because Indy parses them by creating a collection item for each multipart header set, but does not store their content in the same collection items. The content is parsed and separated into additional collection items as needed. And v10 has everything that v9 has, but it also supports things that v9 doesn't, like Unicode, and adequate MIME handling especially for multi-level nesting of parts. v9 simply can't handle modern emails that are beyond the simplest of complexity. v10 can handle them better. You really should upgrade.

              – Remy Lebeau
              Nov 6 '18 at 16:22











            • i have tested with indy 10 but the result is the same. A suspect: in a part of the email there is written: 'this is an s/mime email" But does indy manage s/mime email? I suspect NO, so in wich manner i can read and import data from a such email? Thank You, Fabrizio

              – Fabrizio
              Nov 13 '18 at 18:31














            0












            0








            0







            TIdMessagePart is a TCollectionItem descendant. The TCollectionItem::Collection property points to the owning (parent) TCollection, not to some inner collection, like you are expecting 1. That is why mp1 and mp are pointing at the same address in memory.



            You don't "open a message part" in Indy. You simply iterate the TIdMessage::MessageParts collection from one end to the other until you find the particular part you are interested in, such as by looking at their class type, ContentType properties, etc. For example:



            TIdMessageParts *mp = MailMessage->MessageParts; 

            for (int i = mp->Count-1; i > 0; --i)

            TIdMessagePart *part = mp->Items[i];

            if ((TIdAttachment *att = dynamic_cast<TIdAttachment*>(part)) != NULL)

            ...

            else if ((TIdText *txt = dynamic_cast<TIdText*>(part)) != NULL)

            if (txt->ContentType = "text/xml")

            ...

            else if (txt->ContentType = "text/plain")

            ...





            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.






            share|improve this answer













            TIdMessagePart is a TCollectionItem descendant. The TCollectionItem::Collection property points to the owning (parent) TCollection, not to some inner collection, like you are expecting 1. That is why mp1 and mp are pointing at the same address in memory.



            You don't "open a message part" in Indy. You simply iterate the TIdMessage::MessageParts collection from one end to the other until you find the particular part you are interested in, such as by looking at their class type, ContentType properties, etc. For example:



            TIdMessageParts *mp = MailMessage->MessageParts; 

            for (int i = mp->Count-1; i > 0; --i)

            TIdMessagePart *part = mp->Items[i];

            if ((TIdAttachment *att = dynamic_cast<TIdAttachment*>(part)) != NULL)

            ...

            else if ((TIdText *txt = dynamic_cast<TIdText*>(part)) != NULL)

            if (txt->ContentType = "text/xml")

            ...

            else if (txt->ContentType = "text/plain")

            ...





            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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 5 '18 at 16:33









            Remy LebeauRemy Lebeau

            338k19262456




            338k19262456












            • Inspetting the classname of the two first parts i have seen they are TIdText parts so i inspected them: Part #: 0 - ClassName: TIdText ContentType: multipart/mixed; boundary="----------=_1540469045-26964-21506" Part #: 1 - ClassName: TIdText ContentType: multipart/alternative; boundary="----------=_1540469045-26964-21507" Part #: 2 - ClassName: TIdText ContentType: text/plain; charset="iso-8859-1" Correct test and parts 3 to the end are correct. Parts #0 #1 body properties are empty. They have boundaries so contents are present. A solution to extract the data i need? Thanks

              – Fabrizio
              Nov 5 '18 at 18:08












            • I already gave you the solution in my answer. You can simply ignore the two multipart/... parts while iterating the collection. They are supposed to have empty bodies. Note that Indy 9 really does NOT handle MIME very well, especially multiple levels of nesting. Indy 10 does a better job at that (it has a TIdMessagePart::ParentPart` to handle nesting - Indy 12 will (hopefully) do an even better job of handling nesting). You really shouldn't be using Indy 9 anyway, it is very outdated by modern standards. Is there a reason why you have not upgraded to Indy 10 yet? It still supports BCB6.

              – Remy Lebeau
              Nov 5 '18 at 19:29












            • I can't ignore them because the contents i need are in these parts and scanning all parts i can't find them. I haven't upgraded as v 9 has the funciontions i have needed until now. Thanks for answer Remy.

              – Fabrizio
              Nov 6 '18 at 10:31












            • @Fabrizio yes, you can ignore the multipart parts, because Indy parses them by creating a collection item for each multipart header set, but does not store their content in the same collection items. The content is parsed and separated into additional collection items as needed. And v10 has everything that v9 has, but it also supports things that v9 doesn't, like Unicode, and adequate MIME handling especially for multi-level nesting of parts. v9 simply can't handle modern emails that are beyond the simplest of complexity. v10 can handle them better. You really should upgrade.

              – Remy Lebeau
              Nov 6 '18 at 16:22











            • i have tested with indy 10 but the result is the same. A suspect: in a part of the email there is written: 'this is an s/mime email" But does indy manage s/mime email? I suspect NO, so in wich manner i can read and import data from a such email? Thank You, Fabrizio

              – Fabrizio
              Nov 13 '18 at 18:31


















            • Inspetting the classname of the two first parts i have seen they are TIdText parts so i inspected them: Part #: 0 - ClassName: TIdText ContentType: multipart/mixed; boundary="----------=_1540469045-26964-21506" Part #: 1 - ClassName: TIdText ContentType: multipart/alternative; boundary="----------=_1540469045-26964-21507" Part #: 2 - ClassName: TIdText ContentType: text/plain; charset="iso-8859-1" Correct test and parts 3 to the end are correct. Parts #0 #1 body properties are empty. They have boundaries so contents are present. A solution to extract the data i need? Thanks

              – Fabrizio
              Nov 5 '18 at 18:08












            • I already gave you the solution in my answer. You can simply ignore the two multipart/... parts while iterating the collection. They are supposed to have empty bodies. Note that Indy 9 really does NOT handle MIME very well, especially multiple levels of nesting. Indy 10 does a better job at that (it has a TIdMessagePart::ParentPart` to handle nesting - Indy 12 will (hopefully) do an even better job of handling nesting). You really shouldn't be using Indy 9 anyway, it is very outdated by modern standards. Is there a reason why you have not upgraded to Indy 10 yet? It still supports BCB6.

              – Remy Lebeau
              Nov 5 '18 at 19:29












            • I can't ignore them because the contents i need are in these parts and scanning all parts i can't find them. I haven't upgraded as v 9 has the funciontions i have needed until now. Thanks for answer Remy.

              – Fabrizio
              Nov 6 '18 at 10:31












            • @Fabrizio yes, you can ignore the multipart parts, because Indy parses them by creating a collection item for each multipart header set, but does not store their content in the same collection items. The content is parsed and separated into additional collection items as needed. And v10 has everything that v9 has, but it also supports things that v9 doesn't, like Unicode, and adequate MIME handling especially for multi-level nesting of parts. v9 simply can't handle modern emails that are beyond the simplest of complexity. v10 can handle them better. You really should upgrade.

              – Remy Lebeau
              Nov 6 '18 at 16:22











            • i have tested with indy 10 but the result is the same. A suspect: in a part of the email there is written: 'this is an s/mime email" But does indy manage s/mime email? I suspect NO, so in wich manner i can read and import data from a such email? Thank You, Fabrizio

              – Fabrizio
              Nov 13 '18 at 18:31

















            Inspetting the classname of the two first parts i have seen they are TIdText parts so i inspected them: Part #: 0 - ClassName: TIdText ContentType: multipart/mixed; boundary="----------=_1540469045-26964-21506" Part #: 1 - ClassName: TIdText ContentType: multipart/alternative; boundary="----------=_1540469045-26964-21507" Part #: 2 - ClassName: TIdText ContentType: text/plain; charset="iso-8859-1" Correct test and parts 3 to the end are correct. Parts #0 #1 body properties are empty. They have boundaries so contents are present. A solution to extract the data i need? Thanks

            – Fabrizio
            Nov 5 '18 at 18:08






            Inspetting the classname of the two first parts i have seen they are TIdText parts so i inspected them: Part #: 0 - ClassName: TIdText ContentType: multipart/mixed; boundary="----------=_1540469045-26964-21506" Part #: 1 - ClassName: TIdText ContentType: multipart/alternative; boundary="----------=_1540469045-26964-21507" Part #: 2 - ClassName: TIdText ContentType: text/plain; charset="iso-8859-1" Correct test and parts 3 to the end are correct. Parts #0 #1 body properties are empty. They have boundaries so contents are present. A solution to extract the data i need? Thanks

            – Fabrizio
            Nov 5 '18 at 18:08














            I already gave you the solution in my answer. You can simply ignore the two multipart/... parts while iterating the collection. They are supposed to have empty bodies. Note that Indy 9 really does NOT handle MIME very well, especially multiple levels of nesting. Indy 10 does a better job at that (it has a TIdMessagePart::ParentPart` to handle nesting - Indy 12 will (hopefully) do an even better job of handling nesting). You really shouldn't be using Indy 9 anyway, it is very outdated by modern standards. Is there a reason why you have not upgraded to Indy 10 yet? It still supports BCB6.

            – Remy Lebeau
            Nov 5 '18 at 19:29






            I already gave you the solution in my answer. You can simply ignore the two multipart/... parts while iterating the collection. They are supposed to have empty bodies. Note that Indy 9 really does NOT handle MIME very well, especially multiple levels of nesting. Indy 10 does a better job at that (it has a TIdMessagePart::ParentPart` to handle nesting - Indy 12 will (hopefully) do an even better job of handling nesting). You really shouldn't be using Indy 9 anyway, it is very outdated by modern standards. Is there a reason why you have not upgraded to Indy 10 yet? It still supports BCB6.

            – Remy Lebeau
            Nov 5 '18 at 19:29














            I can't ignore them because the contents i need are in these parts and scanning all parts i can't find them. I haven't upgraded as v 9 has the funciontions i have needed until now. Thanks for answer Remy.

            – Fabrizio
            Nov 6 '18 at 10:31






            I can't ignore them because the contents i need are in these parts and scanning all parts i can't find them. I haven't upgraded as v 9 has the funciontions i have needed until now. Thanks for answer Remy.

            – Fabrizio
            Nov 6 '18 at 10:31














            @Fabrizio yes, you can ignore the multipart parts, because Indy parses them by creating a collection item for each multipart header set, but does not store their content in the same collection items. The content is parsed and separated into additional collection items as needed. And v10 has everything that v9 has, but it also supports things that v9 doesn't, like Unicode, and adequate MIME handling especially for multi-level nesting of parts. v9 simply can't handle modern emails that are beyond the simplest of complexity. v10 can handle them better. You really should upgrade.

            – Remy Lebeau
            Nov 6 '18 at 16:22





            @Fabrizio yes, you can ignore the multipart parts, because Indy parses them by creating a collection item for each multipart header set, but does not store their content in the same collection items. The content is parsed and separated into additional collection items as needed. And v10 has everything that v9 has, but it also supports things that v9 doesn't, like Unicode, and adequate MIME handling especially for multi-level nesting of parts. v9 simply can't handle modern emails that are beyond the simplest of complexity. v10 can handle them better. You really should upgrade.

            – Remy Lebeau
            Nov 6 '18 at 16:22













            i have tested with indy 10 but the result is the same. A suspect: in a part of the email there is written: 'this is an s/mime email" But does indy manage s/mime email? I suspect NO, so in wich manner i can read and import data from a such email? Thank You, Fabrizio

            – Fabrizio
            Nov 13 '18 at 18:31






            i have tested with indy 10 but the result is the same. A suspect: in a part of the email there is written: 'this is an s/mime email" But does indy manage s/mime email? I suspect NO, so in wich manner i can read and import data from a such email? Thank You, Fabrizio

            – Fabrizio
            Nov 13 '18 at 18:31














            0














            The answer to the problem i posted:
            @Remy told me a right observation i was unable to understand well: "The content is parsed and separated into additional collection items as needed."
            The email i'm reading is a 'certified email' so the real email is the attachment with .eml extension that indy where reading and i ignored (my email client shows the attachments in the contained email joined with the attachments of the base email).
            So, when i have right understood the Remy words and realized where to search the attachments:



            1. i have estracted the .eml file to a folder

            2. added a new TIdMessage component on the form (called PartMessage);

            3. used LoadFromFile method to read the stored file
              and now in PartMessage all attachments are visible and i was able to save them as files.

            Thanks again to Remy as his words that where preciouses to reach the solution.



            P.S. The solution works fine for Indy 9 and 10 with necessary adjustments due to different versions.
            P.P.S. i don't know why during my tests i found the text that the email was s/mime encoded as it is not.






            share|improve this answer



























              0














              The answer to the problem i posted:
              @Remy told me a right observation i was unable to understand well: "The content is parsed and separated into additional collection items as needed."
              The email i'm reading is a 'certified email' so the real email is the attachment with .eml extension that indy where reading and i ignored (my email client shows the attachments in the contained email joined with the attachments of the base email).
              So, when i have right understood the Remy words and realized where to search the attachments:



              1. i have estracted the .eml file to a folder

              2. added a new TIdMessage component on the form (called PartMessage);

              3. used LoadFromFile method to read the stored file
                and now in PartMessage all attachments are visible and i was able to save them as files.

              Thanks again to Remy as his words that where preciouses to reach the solution.



              P.S. The solution works fine for Indy 9 and 10 with necessary adjustments due to different versions.
              P.P.S. i don't know why during my tests i found the text that the email was s/mime encoded as it is not.






              share|improve this answer

























                0












                0








                0







                The answer to the problem i posted:
                @Remy told me a right observation i was unable to understand well: "The content is parsed and separated into additional collection items as needed."
                The email i'm reading is a 'certified email' so the real email is the attachment with .eml extension that indy where reading and i ignored (my email client shows the attachments in the contained email joined with the attachments of the base email).
                So, when i have right understood the Remy words and realized where to search the attachments:



                1. i have estracted the .eml file to a folder

                2. added a new TIdMessage component on the form (called PartMessage);

                3. used LoadFromFile method to read the stored file
                  and now in PartMessage all attachments are visible and i was able to save them as files.

                Thanks again to Remy as his words that where preciouses to reach the solution.



                P.S. The solution works fine for Indy 9 and 10 with necessary adjustments due to different versions.
                P.P.S. i don't know why during my tests i found the text that the email was s/mime encoded as it is not.






                share|improve this answer













                The answer to the problem i posted:
                @Remy told me a right observation i was unable to understand well: "The content is parsed and separated into additional collection items as needed."
                The email i'm reading is a 'certified email' so the real email is the attachment with .eml extension that indy where reading and i ignored (my email client shows the attachments in the contained email joined with the attachments of the base email).
                So, when i have right understood the Remy words and realized where to search the attachments:



                1. i have estracted the .eml file to a folder

                2. added a new TIdMessage component on the form (called PartMessage);

                3. used LoadFromFile method to read the stored file
                  and now in PartMessage all attachments are visible and i was able to save them as files.

                Thanks again to Remy as his words that where preciouses to reach the solution.



                P.S. The solution works fine for Indy 9 and 10 with necessary adjustments due to different versions.
                P.P.S. i don't know why during my tests i found the text that the email was s/mime encoded as it is not.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 15 '18 at 13:07









                FabrizioFabrizio

                12




                12



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53153989%2fc-builder-indy-receiving-certified-emails%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    27

                    Top Tejano songwriter Luis Silva dead of heart attack at 64

                    Category:Rhetoric