cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Send HTTP POST with email attachment

Hi, 

 

I'm currently trying to create a flow that is triggered when a new email is received and for each of the attachments creates an HTTP requests which posts the content to a backend server for further processing of the file.

 

I tried setting the file as content body and also as a request parameter' file. In all cases, I'm receiving that the file is Null at the backend.

I've also tried posting the array of attachments and I get a Json like this:

[{
	@odata.type = #Microsoft.OutlookServices.FileAttachment,
	Id = AQMkADNmNWYwMWViLT...,
	Name = myPhoto.jpg,
	ContentType = image / jpeg,
	Size = 19092,
	ContentBytes = null
}, {
	@odata.type = #Microsoft.OutlookServices.FileAttachment,
	Id = AQMkADNmNWYwMWViLTcx... ,
	Name = My PDF.pdf,
	ContentType = application / pdf,
	Size = 44972,
	ContentBytes = null
}]

The problem I have is that contentBytes is always null. If I try to loop trough each of the attachments and get the content, I post a null value in the request body.

 

What's the proper way to post an email attachment to an HTTP request?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Member

Re: Send HTTP POST with email attachment

After serveral hours of debugging and crying in the corner, I just figured out what was wrong. I wasn't including the email attachments from the initial trigger action. Make sure to select "Include email attachment".

The attachment is encoded in Base64.

View solution in original post

2 REPLIES 2
Highlighted
New Member

Re: Send HTTP POST with email attachment

After serveral hours of debugging and crying in the corner, I just figured out what was wrong. I wasn't including the email attachments from the initial trigger action. Make sure to select "Include email attachment".

The attachment is encoded in Base64.

View solution in original post

Highlighted
New Member

Re: Send HTTP POST with email attachment

Hi,

I want to send an email with attachment. 

My requirement 

  1. Want to send an attachment in the HTTP post using( When a HTTP request is received.)
  2. Extract the attachment from the URL and store the attachment in the variable
  3. Add the variable to the email attachment.
  4. Finally return Response after send the mail.

I know how to send a normal email without attachment. But i want to send with attachment. Please help me !!

@AlexRD Can you explain how you are sending an attachment using HTTP post request and adding the attachment to the email connector.

 

Thanks in advance.

 

Helpful resources

Announcements
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (8,679)