cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Advocate IV
Advocate IV

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
Highlighted
Power Automate
Power Automate

Re: Send email with attachment

Make sure "Include Attachments" is set to True.

 

Capture.PNG

Highlighted
Advocate IV
Advocate IV

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

Highlighted
Power Automate
Power Automate

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.

Highlighted
Advocate IV
Advocate IV

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

 

Highlighted
Power Automate
Power Automate

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.

 

 

Highlighted
Advocate IV
Advocate IV

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

Highlighted
Advocate IV
Advocate IV

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

Highlighted
Advocate IV
Advocate IV

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.

Highlighted
Advocate IV
Advocate IV

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?

Highlighted
Advocate IV
Advocate IV

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
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Users online (7,183)