web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Using Connectors
Unanswered

Issue with "Send an HTTP Request" to create draft email with attachment

(0) ShareShare
ReportReport
Posted on by 4

Hi everyone,

 

I am trying to use “Send an HTTP Request” in Power Automate to create a draft email. I want it to:


  • Include text in the body

  • Add recipients in CC


  •  

This works fine when I don’t include an attachment or when there are CC recipients.

 

However, when I try to add a DOCX attachment, I get a Bad Request / error. I have tried setting Content-Type to application/json and using Base64 encoding for the file content, but nothing seems to work.

I can show an example of the code that works and the code that fails.

 

Could someone advise:


  1. Why adding a DOCX attachment causes this error

  2. How I can fix it so I can create draft emails with attachments


  3.  

Thanks in advance!

 
 
This code works:

{
  "subject": "Reminder: Uren niet ingevuld",
  "importance": "normal",
  "body": {
    "contentType": "html",
    "content": "<p>Beste @{outputs('Naam_voor_aanmaning')},"
  },
  "toRecipients": [
    {
      "emailAddress": {
        "address": "@{outputs('Compose_8')}"
      }
    }
  ]
}

this code does not work:
 
{
  "subject": "Reminder: Uren niet ingevuld",
  "importance": "normal",
  "body": {
    "contentType": "html",
    "content": "<p>Hi Nalie,"
  },
  "toRecipients": [
    {
      "emailAddress": {
        "address": "a@st.nl"
      }
    }
  ],
  "attachments": [
    {
      "@odata.type": "#microsoft.graph.fileAttachment",
      "name": "voorbeeld.docx",
      "contentType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
      "contentBytes": "@{base64(body('Get_file_content_using_path'))}"
    }
  ]
}


btw i tried also only dynamic file content and also without "@" and without base 64 just nothing works
Categories:
I have the same question (0)
  • VictorIvanidze Profile Picture
    12,932 on at
    Issue with "Send an HTTP Request" to create draft email with attachment
  • MM-26060905-0 Profile Picture
    4 on at
    Issue with "Send an HTTP Request" to create draft email with attachment
    @VictorIvanidze

    Im sorry this does not help my problem. I get this problem Action 'Send_an_HTTP_request' failed: The OData request is not supported.
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 438 Moderator

#3
chiaraalina Profile Picture

chiaraalina 258

Last 30 days Overall leaderboard

Featured topics