cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

"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
v-yuxima-msft
Community Support
Community Support

Hi @Anonymous ,

 

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
v-yuxima-msft
Community Support
Community Support

Hi @Anonymous ,

 

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

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,240)