This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Tech Community.
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.
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.
As an example, let's receive the following email with attachments (as shown in the Outlook desktop app):
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.
Each part of the BizTalk message contains character set information, and MIME type as content type.
2. MIME Content
The second way to receive attachments is by choosing MIME email payload, as shown below:
In this case, the BizTalk message body will contain the entire MIME representation of the email (headers, body and attachments).
Sending Attachments
Let's consider an email send port with the configuration below.
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.
For illustration, we forwarded the email with attachments received earlier. The corresponding BizTalk multipart message looked like:
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.
References: