cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lloyd
Advocate IV
Advocate IV

Send email with attachment

Does anyone know how to set up a flow to capture an e-mail attachment, and send it on again in a new email?

 

My flow is designed to check a shared mailbox for messages with attachments, then send them again to a different address.

 

I'm able to get the right content through from the old subject to the new subject, and also with the body. But I get an error:

{
  "status": 400,
  "message": "Parameter 'Attachment Name' cannot be null or empty.",
  "source": "127.0.0.1"
}

 

I've tried putting both the Attachment Name and the Attachment ID field in the Attachments Name field, and the Attachment ID and the Attachment Content fields in the Attachments Content for the "Send an email" step, but it's obviously not carrying through the email from the previous step. Has anyone achieved this successfully?

 

Bonus question... what I'd actually like to do is drop the attachment directly into a Slack channel... but as far as I have seen, you can only send text messages through the Slack connection.

 

Cheers

1 ACCEPTED SOLUTION

Accepted Solutions

It worked when I used "Attachment Name" [ends with] ".pdf"

 

Thanks @ashgupta and @SameerCh for your help!

View solution in original post

10 REPLIES 10
prabir
Power Automate
Power Automate

Make sure "Include Attachments" is set to True.

 

Capture.PNG

Hi Prabir,

 

Thanks for your message. I have already set "Include Attachments" to "Yes" although after saving the Flow, it changes to "true" which I assume is not a problem.

 

Flow attachment.gif

 

Are there any other settings which you would change?

 

Cheers

@Lloyd This is a known limitation of the product. Attachments is a collection so you can not use them as attachments in the send email action.

 

You can workaround but adding a apply-to-each step and send email with attachment but it would mean there would be 1 email for each attachment that you receive.

 

We are looking to improve this experience on the product side.

Thanks @ashgupta!

I have tried the following, do you think it is correct? I will find out tomorrow if it works!

Flow attachment2.png

 

The Content-Type is not true.  The content type is a mime type like "application/pdf".

You can use the Filename end with ".pdf" instead.

 

 

Thanks @SameerCh, I appreciate your help. I have now entered "application/pdf" without the quotes.

 

Do you think the above will work? The other option is to check "Attachment Name" [ends with] ".pdf" ?

It worked when I used "Attachment Name" [ends with] ".pdf"

 

Thanks @ashgupta and @SameerCh for your help!

@Lloyd, The .pdf files work with me. Did you get to work with files other than .pdf? If so, please share.

I haven't had a need for a general solution, as the attachments I'm expecting are all PDFs.

 

@ashguptamentioned "Attachments is a collection so you can not use them as attachments in the send email action" and that they were looking to improve this, potentially now you don't need to isolate individual attachments?

Thank you @Lloyd. I used for-each like @ashgupta mentioned however it doesn't work with other file types than .pdf. 

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,933)