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

Suhabavan
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
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (7,048)