cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Oregani
Level: Power Up

"status": 400 Message when trying to send email from powerapps app without attachment

Hi,

 

I'm new to powerapps.

 

I've put together a one screen app that collects some text fields and you have the option to attach a photo.  I have  a submit button that has the following formula for OnSelect:

 

'Outlook.com'.SendEmailV2("XXXXXX@XXXX.com", "SHE Observation Report", HTML_Record.HtmlText,{Cc:"XXXXX@XXXXX.com", Attachments:Table({Name:"Image.jpg", ContentBytes:AddMedia.Media, '@odata.type':""})})

When I run the app, it works perfectly provided I have added an attachment. However when I dont, I get the following message:

 

Outlook.com.SendEmailV2 failed: {"status":400, "message": Parameter 'Attachment Cotnent' cannot be null or empty...

 

I have searched forums and seen similar issues but no resolution, can anyone help me with this?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: "status": 400 Message when trying to send email from powerapps app without attachment

Hi @Oregani ,

 

You should add one content of ContentBytes, if not it will show this error.

Could you please change your formula as this?

Office365.SendEmailV2("xxxx", "SHE Observation Report", HTML_Record.HtmlText,{Cc:"xxxx", Attachments:Table({Name:"Image.jpg", ContentBytes:AddMediaButton1.Media, '@odata.type':""})})

I test on my side and it works ok.

20190501sendattachmentwithemail.PNG

20190501sendattachmentwithemail2.PNG

 

More information:

connection-office365-outlook

 

Hope this could be helpful.

 

Best Regards.

Yumia

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: "status": 400 Message when trying to send email from powerapps app without attachment

Hi @Oregani ,

 

You should add one content of ContentBytes, if not it will show this error.

Could you please change your formula as this?

Office365.SendEmailV2("xxxx", "SHE Observation Report", HTML_Record.HtmlText,{Cc:"xxxx", Attachments:Table({Name:"Image.jpg", ContentBytes:AddMediaButton1.Media, '@odata.type':""})})

I test on my side and it works ok.

20190501sendattachmentwithemail.PNG

20190501sendattachmentwithemail2.PNG

 

More information:

connection-office365-outlook

 

Hope this could be helpful.

 

Best Regards.

Yumia

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Users online (3,371)