%3CLINGO-SUB%20id%3D%22lingo-sub-1218209%22%20slang%3D%22en-US%22%3EAttachments%20in%20the%20Office%20365%20Outlook%20Email%20Adapter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1218209%22%20slang%3D%22en-US%22%3E%3CP%3EStarting%20with%20the%20release%20of%20BizTalk%20Server%202020%2C%20email%20attachments%20are%20supported%20by%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Foffice365-mail-adapter%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOffice%20365%20Outlook%20Email%20adapter.%3C%2FA%3E%20As%20a%20growing%20number%20of%20businesses%20are%20adopting%20Office%20365%2C%20this%20new%20feature%20is%20an%20interesting%20alternative%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Fpop3-adapter%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPOP3%20Adapter%3C%2FA%3E%20on%20the%20receive%20side%2C%20and%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Fsmtp-adapter%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESMTP%20Adapter%3C%2FA%3E%20on%20the%20send%20side%2C%20in%20scenarios%20such%20as%20(non-exhaustive%20list)%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EMigration%20of%20existing%20deployed%20POP3%2FSMTP%20BizTalk%20applications%20to%20a%20more%20modern%20platform%3B%3C%2FLI%3E%0A%3CLI%3EIntegration%20of%20Office%20365%20and%20BizTalk%20to%20transfer%20data%20via%20email%20attachment%20payloads%3B%3C%2FLI%3E%0A%3CLI%3EOrganizations%20that%20use%20Outlook%20365%20by%20%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Fadd-your-other-email-accounts-to-outlook-com-c5224df4-5885-4e79-91ba-523aa743f0ba%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Econnecting%20other%20email%20accounts%3C%2FA%3E.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EThe%20article%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Foffice-365-outlook-adapters-in-action%2Fba-p%2F1230054%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EOffice%20365%20Outlook%20Adapters%20in%20Action%3C%2FA%3E%20provides%20an%20example%20of%20how%20to%20use%20attachments%20in%20a%20BizTalk%20ochestration.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%225%22%20color%3D%22%230000FF%22%3EReceiving%20Attachments%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3E1.%20Multipart%20BizTalk%20Messages%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20first%20way%20to%20receive%20and%20save%20attachments%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Foffice365-mail-adapter%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EOffice%20365%20Outlook%20Email%20adapter%3C%2FA%3E%20is%20by%20creating%20a%20multipart%20BizTalk%20message%20where%20each%20part%20corresponds%20to%20an%20attachment.%20This%20is%20equivalent%20to%20the%20%3CEM%3EApply%20MIME%20decoding%3C%2FEM%3E%20option%20set%20to%20true%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Fhow-to-configure-a-pop3-receive-location%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EPOP3%20adapter%20configuration%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3EThe%20receive%20location%20transport%20property%20settings%20for%20this%20configuration%20are%20shown%20below.%20Note%20that%20by%20default%2C%20the%20%22Include%20attachments%22%20checkbox%20is%20unchecked%2C%20and%20it%20needs%20to%20be%20checked%20explicitly.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BlogArticle2_ReceiveProperties.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F175991iB8752E0D8144F47D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22BlogArticle2_ReceiveProperties.jpg%22%20alt%3D%22BlogArticle2_ReceiveProperties.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20an%20example%2C%20let's%20receive%20the%20following%20email%20with%20attachments%20(as%20shown%20in%20the%20Outlook%20desktop%20app)%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BlogArticle2_OutlookEmail.jpg%22%20style%3D%22width%3A%20784px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F176055i4CDB87D86540E5AF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22BlogArticle2_OutlookEmail.jpg%22%20alt%3D%22BlogArticle2_OutlookEmail.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20corresponding%20BizTalk%20message%2C%20shown%20in%20the%20screenshot%20below%2C%20will%20have%20one%20part%20per%20attachment.%20The%20part%20named%20%22body%22%20corresponds%20to%20the%20email%20body%20as%20sent%20by%20the%20server%2C%20which%20is%20with%20HTML%20body%20type%20by%20default%20in%20Outlook%20365.%20Subsequent%20parts%20are%20named%20after%20the%20attachment%20names.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BlogArticle2_ReceivedMultipartBizTalkMessage.jpg%22%20style%3D%22width%3A%20986px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F176006i16872446F55CCC92%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22BlogArticle2_ReceivedMultipartBizTalkMessage.jpg%22%20alt%3D%22BlogArticle2_ReceivedMultipartBizTalkMessage.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEach%20part%20of%20the%20BizTalk%20message%20contains%20character%20set%20information%2C%20and%20MIME%20type%20as%20content%20type.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BlogArticle2_ReceivedMultipartBizTalkMessage2.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F176007i6830C4B5A224DE71%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22BlogArticle2_ReceivedMultipartBizTalkMessage2.jpg%22%20alt%3D%22BlogArticle2_ReceivedMultipartBizTalkMessage2.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3E2.%20MIME%20Content%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20second%20way%20to%20receive%20attachments%20is%20by%20choosing%20MIME%20email%20payload%2C%20as%20shown%20below%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BlogArticle2_ReceivePropertiesMIME.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F175997i5D873EC45B584A82%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22BlogArticle2_ReceivePropertiesMIME.jpg%22%20alt%3D%22BlogArticle2_ReceivePropertiesMIME.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20case%2C%20the%20BizTalk%20message%20body%20will%20contain%20the%20entire%20MIME%20representation%20of%20the%20email%20(headers%2C%20body%20and%20attachments).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BlogArticle2_ReceivedMIME.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F176000iF878CAF372353689%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22BlogArticle2_ReceivedMIME.jpg%22%20alt%3D%22BlogArticle2_ReceivedMIME.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%225%22%20color%3D%22%230000FF%22%3ESending%20Attachments%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet's%20consider%20an%20email%20send%20port%20with%20the%20configuration%20below.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BlogArticle2_SendProperties.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F176002iAAB8AC039A33E0CA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22BlogArticle2_SendProperties.jpg%22%20alt%3D%22BlogArticle2_SendProperties.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESend%20ports%20with%20transport%20type%20Office%20365%20Outlook%20Email%20can%20be%20configured%20to%20attach%20the%20parts%20of%20a%20multipart%20BizTalk%20message%20to%20an%20email%2C%20as%20well%20as%20specific%20files.%20This%20is%20the%20equivalent%20of%20the%20%3CEM%3EMessagePartsAttachments%3C%2FEM%3E%20and%20%3CEM%3EAttachments%3C%2FEM%3E%20properties%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Fhow-to-configure-an-smtp-send-port%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ESMTP%20send%20port%20configuration%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BlogArticle2_SendProperties2.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F176003iD75AB7EA867E6AB9%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22BlogArticle2_SendProperties2.jpg%22%20alt%3D%22BlogArticle2_SendProperties2.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20illustration%2C%20we%20forwarded%20the%20email%20with%20attachments%20received%20earlier.%20The%20corresponding%20BizTalk%20multipart%20message%20looked%20like%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BlogArticle2_MultipartMessageForwarded.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F176005i8390F8B34D6912F1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22BlogArticle2_MultipartMessageForwarded.jpg%22%20alt%3D%22BlogArticle2_MultipartMessageForwarded.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20email%20sent%20by%20the%20send%20port%20is%20shown%20below%2C%20in%20the%20Outlook%20desktop%20client%20app%20used%20by%20the%20recipient.%20Note%20that%20the%20attachment%20types%20are%20preserved%2C%20and%20the%20body%20is%20shown%20as%20HTML%20in%20the%20same%20way%20as%20the%20original%20email.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BlogArticle2_OutlookEmailReceived.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F176056iE69F04756546C019%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22BlogArticle2_OutlookEmailReceived.jpg%22%20alt%3D%22BlogArticle2_OutlookEmailReceived.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3EReferences%3C%2FSTRONG%3E%3C%2FFONT%3E%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Foffice365-mail-adapter%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOffice365%20Outlook%20Email%20adapter%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Fpop3-adapter%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPOP3%20Adapter%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fbiztalk%2Fcore%2Fsmtp-adapter%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESMTP%20Adapter%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fbiztalk-server-team-blog%2Foffice-365-outlook-adapters-in-action%2Fba-p%2F1230054%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EOffice%20365%20Outlook%20Adapters%20in%20Action%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1218209%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Ebiztalk%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E

Starting with the release of BizTalk Server 2020, email attachments are supported by the Office 365 Outlook Email adapter. As a growing number of businesses are adopting Office 365, this new feature is an interesting alternative to the POP3 Adapter on the receive side, and to the SMTP Adapter on the send side, in scenarios such as (non-exhaustive list):

  • Migration of existing deployed POP3/SMTP BizTalk applications to a more modern platform;
  • Integration of Office 365 and BizTalk to transfer data via email attachment payloads;
  • Organizations that use Outlook 365 by connecting other email accounts.

The article Office 365 Outlook Adapters in Action provides an example of how to use attachments in a BizTalk ochestration.

 

Receiving Attachments

 

1. Multipart BizTalk Messages

 

The first way to receive and save attachments in the Office 365 Outlook Email adapter is by creating a multipart BizTalk message where each part corresponds to an attachment. This is equivalent to the Apply MIME decoding option set to true in the POP3 adapter configuration.

The receive location transport property settings for this configuration are shown below. Note that by default, the "Include attachments" checkbox is unchecked, and it needs to be checked explicitly.

 

BlogArticle2_ReceiveProperties.jpg

 

As an example, let's receive the following email with attachments (as shown in the Outlook desktop app):

 

BlogArticle2_OutlookEmail.jpg

The corresponding BizTalk message, shown in the screenshot below, will have one part per attachment. The part named "body" corresponds to the email body as sent by the server, which is with HTML body type by default in Outlook 365. Subsequent parts are named after the attachment names.

 

BlogArticle2_ReceivedMultipartBizTalkMessage.jpg

 

Each part of the BizTalk message contains character set information, and MIME type as content type.

 

BlogArticle2_ReceivedMultipartBizTalkMessage2.jpg

 

2. MIME Content

 

The second way to receive attachments is by choosing MIME email payload, as shown below:

 

BlogArticle2_ReceivePropertiesMIME.jpg

 

In this case, the BizTalk message body will contain the entire MIME representation of the email (headers, body and attachments).

 

BlogArticle2_ReceivedMIME.jpg

 

Sending Attachments

 

Let's consider an email send port with the configuration below.

 

BlogArticle2_SendProperties.jpg

 

Send ports with transport type Office 365 Outlook Email can be configured to attach the parts of a multipart BizTalk message to an email, as well as specific files. This is the equivalent of the MessagePartsAttachments and Attachments properties in the SMTP send port configuration.

 

BlogArticle2_SendProperties2.jpg

 

For illustration, we forwarded the email with attachments received earlier. The corresponding BizTalk multipart message looked like:

 

BlogArticle2_MultipartMessageForwarded.jpg

 

The email sent by the send port is shown below, in the Outlook desktop client app used by the recipient. Note that the attachment types are preserved, and the body is shown as HTML in the same way as the original email.

 

BlogArticle2_OutlookEmailReceived.jpg

 

References: