How to retrieve body from a pop3 message

Home Page Forums BizTalk 2004 – BizTalk 2010 How to retrieve body from a pop3 message

Viewing 1 reply thread
  • Author
    Posts
    • #15933

      Hi

       I have been fighting the pop3 adapter for a while now, and I am about to give it up… My scenario is as follows:

       Receiving a message by pop3 adapter. Pipeline is passthrough, and the message in orchestration is defined as XmlDocument, (Have also tried to define a multipart message with a few parts, each defined as XmlDocument)

      I can easy access the properties as EmailMsg(POP3.Subject) and so on, but how do I retrieve the body of the message. I am aware of the body part index, and are able to write the EmailMsg to a file port. The content of the written file is the body of the email, but I need to retrieve the body from the emailmsg for use in the orchestration.

       Does anybody have some ideas, or even better, an example of how to do this?

      Regards
      Tore T

    • #15946

      Does this (http://blogs.msdn.com/richardbpi/archive/2006/02/03/524484.aspx) help at all?  Can you not grab the messagepart content that holds the body text?

      • #15959

        I do have the messagepart that holds the text. And I solved this by creating a .net class that takes a XLANGMessage variable in, read the part as  a stream into a bytearray, and converting this into a string variable which is returned.

        This certanly solved it, but it seems to be to complicated to be the best way to do it. The issue is that since I have to define the message in as XmlDocument, but the pipeline is PassThrough, I end up with data in a XmlDocument that is not valid. As soon I try to access the XmlDocument it failes, because it try to validate the xml, which is incorrect.

        So, the only way I foun around this was to read this as a stream.

        Tore

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.