Office365 adapter - attachment filenames?

Kotus 31 Reputation points
2022-12-06T13:18:16.3+00:00

Hi,

I'm receiving emails with attachments in BizTalk 2020, using the Office365 email adapter.
I'm using an orchestration to loop through the message parts, extracting and saving all attachments.

I used a similar orchestration for POP3 emails, and was able to use an expression like msgPart(MIME.FileName)
to retrieve the original attachment filename for each attachment message part.
But this doesn't work for the OfficeMail message parts?

Does anyone know how to retrieve the attachment filenames for Office 365 emails from within an orchestration?
(I want to save the files with their original filenames)

Microsoft BizTalk Server
Microsoft BizTalk Server
A family of Microsoft server products that support large-scale implementation management of enterprise application integration processes.
364 questions
0 comments No comments
{count} vote

Accepted answer
  1. Colin Dijkgraaf 1,356 Reputation points
    2022-12-07T07:45:53.247+00:00

    You will want to read Send and receive email with Office 365 Outlook Email adapter - BizTalk Server - Receive email using a receive port where it mentions the promoted property are under OfficeMail, e.g. OfficeMail.HasAttachments

    For the send it has the following property, but is unclear if it uses that for the Receive as well.

    The OfficeMail.AttachedFiles property value is list of files with "|" as delimiter in between different files. For instance: "C:\Attachments\File1.pdf|C:\Attachments\File2.xml".

    The is also a property on on the Payload Tab, which is Deliver MIME. Have you tried it with that setting?

    See also Attachments in the Office 365 Outlook Email Adapter, which mentions that the filename is the Message Parts name.


1 additional answer

Sort by: Most helpful
  1. Kotus 31 Reputation points
    2022-12-07T12:24:52.563+00:00

    Aha!

    ColinDijkgraaf, your reply prompted me to try with the "Deliver MIME" payload after all... but I used the BizTalk MIME decoder in a pipeline, so my orchestration still receives the kind of multipart message it expects.

    Going through the MIME decoder apparently makes the expression MsgPart(MIME.FileName) available again, to retrieve filenames - whereas that failed for me if the message came directly from the Office email adapter.

    I am now able to save mail attachments with their original filenames!

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.