Professional Documents
Culture Documents
Utilities\Samples\BTSUtils.Adapters.POP3.MultiPartMessage\Input\Test Message.eml
Overview
Both the POP3 and SMTP Receive Adapter included within BizTalk Utilities provide a
processing model called Multipart.
When an email message is received by any of these Adapters, the email message body and
all of its attachments are submitted as a single message to BizTalk Server. If the body exists
within the email it will be submitted as the main message part and all of the attachments as
parts of the BizTalk message.
The attachment message parts will be named according to the file names provided within the
email message.
It is important to note that the message body and attachments will be submitted in their raw
format to BizTalk Server. For instance, if the email message contains a Microsoft Word
document, the document will be submitted as a Word document to BizTalk Server.
Orchestration References
The Orchestration references the BTSUtils.Mail.Schemas.Properties project contained within
the same solution in order to use the Mail Property Schemas.
The Expression simply assigns a new Stream object which takes the Body part of the Email
Message.
The Retrieve Attachment 1 and Retrieve Attachment 2 Shapes are exactly the same except
they retrieve the Attachment1 and Attachment2 parts and assign them to the
Attachment1Message and Attachment2Message messages.
Send Body
This Send Shape is responsible for sending the Body Part of the Email Message to the
BodyPort Port.
BodyPort
The EmailMultipartType contains 3 parts namely Body, Attachment1and Attachment2. This is The port is responsible for sending the BodyMessage to the following file location
exactly the same as our email message. If more attachments need to be processed the type
can be extended to have more parts. C:\Program Files\BizTalk
Utilities\Samples\BTSUtils.Adapters.POP3.MultiPartMessage\Output\Body_%MessageId%.ou
One strange thing that you will notice is that these part types are set to t
System.Xml.XmlDocumnet. We are not processing Xml data here though. The Body is Text,
Attachment1 is an HTML document and Attachment2 is a Word document. For some reasons Attachment1Port and Attachment2Port do exactly the same except that they will use a
this seems to work though, so we will not delve deeper on this topic. different filename as to not overwrite the Body Message.
Extract Parts
Configuring the POP3 Receive Location
This Construct Message shape is responsible for extracting the various parts of the email
message from the EmailMessage Multipart Message. It constructs 3 messages namely In this section we will configure the POP3 Receive Location.
BodyMessage, Attachment1Message and Attachment2Message. All of these messages have
a Message Type of BTSUtils.XLANGs.Components.Formatters.Stream. 1. Create a new Receive Port called POP3 Receive Port.
The POP3 Receive Port will pick up the message at the specified interval. All Message Parts
will be written to the
C:\Program Files\BizTalk
Utilities\Samples\BTSUtils.Adapters.POP3.MultiPartMessage\Output