cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Lloyd
Level: Powered On

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
Lloyd
Level: Powered On

Re: Send email with attachment

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
Flow Staff prabir
Flow Staff

Re: Send email with attachment

Make sure "Include Attachments" is set to True.

 

Capture.PNG

Lloyd
Level: Powered On

Re: Send email with attachment

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

Flow Staff ashgupta
Flow Staff

Re: Send email with attachment

@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.

Lloyd
Level: Powered On

Re: Send email with attachment

Thanks @ashgupta!

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

Flow attachment2.png

 

Flow Staff SameerCh
Flow Staff

Re: Send email with attachment

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.

 

 

Lloyd
Level: Powered On

Re: Send email with attachment

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" ?

Lloyd
Level: Powered On

Re: Send email with attachment

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

 

Thanks @ashgupta and @SameerCh for your help!

View solution in original post

pNabin
Level 8

Re: Send email with attachment

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

Lloyd
Level: Powered On

Re: Send email with attachment

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?

pNabin
Level 8

Re: Send email with attachment

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 379 members 6,536 guests
Please welcome our newest community members: