1

I've created a flow that will send an email to my group whenever there's a new request from our SharePoint site.

I would like to add/attach an attachment in sending the email from sharepoint list.

I've used HTTP request to Sharepoint. Using this:

Site Address: \sharepoint_site\
Method: POST
Uri: _api/SP.Utilities.Utility.SendEmail
Headers: accept = application/json;odata=nometadata
         content-type = application/json;odata=nometadata
Body: { 
       'properties':{
       'To':['email@email.com']
       'Body': 'Hello world!'
       'Subject': 'Request #1'
        }
      }

I don't how to add the attached file from the list. My goal is on every request we will received an email with attachments and the attached file will be automatically delete when the flow is successful.

Any idea on how it will work?.

thanks in advance.

![enter image description here

  • Why are you not using Send an email action in microsoft flow like this? – Ganesh Sanap Jul 17 at 6:20
  • Hi @GaneshSanap, I've already tried using Send an email action, it works well, but the From(Send as) address was sent on behalf of me, since I am the one who created the flow. I want no-reply@sharepointonline.com to be the Send as address which works in Send an HTTP request action. – Cleo Jul 17 at 8:20
  • Are you not able to enter this email in From textbox? – Ganesh Sanap Jul 17 at 8:54
  • @GaneshSanap yes I tried to input the email of the requester which is included on the sharepoint list. But I'm getting an error, it says that I not allowed/authorize to use that email... – Cleo Jul 17 at 9:44
  • you tried putting this no-reply@sharepointonline.com email in From section? – Ganesh Sanap Jul 17 at 9:45
0

Another way to do this is using Send Email Action item(outlook 365). Below is how it will look, you can add attachment directly in action by using File content as dynamic data. As you are doing on List with attachments flow would be little long. Below is screenshot for your reference. Just tried this, it is working.

enter image description here

Important note - In below ContentBytes should be added as expression

body('Get_attachment_content').$content

enter image description here

Below action should be outside of ApplyForEach loop.

enter image description here

  • Hi sir, thank you for your answer. :) But if I used that way it will send automatically on my behalf even though I'm not the one who created/adding a request. Since I am the one who created the flow. :) – Cleo Jul 19 at 2:39
  • did you try to put From email address? – Siddharth Vaghasia Jul 19 at 4:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.