cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Cayshin
Resolver I
Resolver I

Send an Outlook email with attachments (an array of PDF attachments) - PDFs become corrupted

EDIT:

After some more searching, l I figured out the issue with the help of this video: https://powerusers.microsoft.com/t5/Webinars-and-Video-Gallery/Add-multiple-attachments-to-an-email-...

 

Essentially, "ContentBytes" is actually built up of two parts: "$content-type" and "$content". The "Content Bytes" Dynamic Content output from "Get Attachments (V2)" action is actually only the $content portion, so it's missing the $content-type.

 

I resolved this by just editing the "Append to array" to include both those pieces.

Here's what I did:

Cayshin_0-1626970609177.png

 

Now when I send the emails, the PDF attachments work as expected.

 

---------------------------------------------------------------------------------------------

 

 

Hi,

 

I'm building a flow where I have an incoming email with multiple PDF attachments. I'm taking those PDFs and then organizing them by who they need to be forwarded to. For example, PDF1 and PDF2 go to Person1@email.com and PDF3 and PDF4 go to Person2@email.com. So the Flow does a Send Email action for each group of PDFs to the specific person. There's no issue here.

 

The problem I'm running into is after the emails are sent, the PDF attachments in those emails are corrupted.

Here's a simplified version of what I'm doing.

Cayshin_0-1626966567748.png

Cayshin_1-1626966597809.png

So in the above Flow, it's taking each attachment and appending to the PDFArray its Name and ContentBytes.

Then, It's sending an email with the array as an Attachment.

The email is sent successfully. In the email, the attachments have the correct file name and file size, but trying to open one gives a "Adobe Acrobat could not open XXX because it is either not supported or...." error.

 

I've compared the ContentBytes of the original attachment(s) to what is appended to the PDFarray and they are exactly the same.

 

Anyone know what I might be doing wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
v-LilyW-msft
Community Support
Community Support

Hi @Cayshin 

Yes, the Value content of Append to array variable should be as below:

vLilyWmsft_1-1627463738391.png

Thanks for your posting here and sharing the solution in the forum as it would be helpful to anyone who encounters similar issues.

Best Regards.

 

View solution in original post

2 REPLIES 2
JuanPJesusG
Frequent Visitor

Hi

 

Json code is case sensitive. That could be your error. Try using "name" and "contentBytes" in your array variable.

JuanPJesusG_0-1626971556495.png

JuanPJesusG_1-1626971613099.png

 

Also, I had some issues when I ran a flow using the test flow option (flow that involves PDFs). Could you try running a flow from scratch?

 

Regards

JP

v-LilyW-msft
Community Support
Community Support

Hi @Cayshin 

Yes, the Value content of Append to array variable should be as below:

vLilyWmsft_1-1627463738391.png

Thanks for your posting here and sharing the solution in the forum as it would be helpful to anyone who encounters similar issues.

Best Regards.

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,538)