cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jschudel
Level: Powered On

New Bug: Sending Email with attachment doesn't work in mobile

My app is setup to save an email's attachments to a local collection, and then to attach that collection to a new email sent from PowerApps. (Not through a flow, but through Office365.SendEmail)

 

This works perfectly in a desktop or laptop's browser. And it used to work fine in mobile devices as well. But that's changed the last couple of days. Now, when we try to send that email in mobile, we get an error message that says:

 

Office365.SendEmail failed: { "status": 400, "message": "Parameter 'Attachment Content' cannot be null or empty...

 

Typically, when the attachments are under 1 MB, this error doesn't always occur. When they're over a few MB (ranging from 4-16 MB in our tests), the error usually appears. But again, only in mobile.

 

I can't find any problems that would cause this, since the app does work fine on a desktop. But if anyone has ideas on the cause or how to fix this, please help!

 

We've had a lot more errors appear in our app, especially mobile, over the last couple days than we have over the past few weeks. And we really haven't changed anything! Not sure if it was the most recent PowerApps update or what...

1 ACCEPTED SOLUTION

Accepted Solutions
HelloWorld1
Level: Powered On

Re: New Bug: Sending Email with attachment doesn't work in mobile

Hi @TopShelf-MSFT thanks for your reply. This was helpful but for some reason the error dissappeared. I'm not sure why it worked perfectly, then I recieved that error and it is like it resolved itself. Maybe there was an issue with getting the email address from the backend in the cloud? Not sure but again thanks for taking the time to reply back to me.

11 REPLIES 11
Community Support Team
Community Support Team

Re: New Bug: Sending Email with attachment doesn't work in mobile

Hi @jschudel,

 

Could you please share a screenshot of your issue?

 

The error message told that your Attachment Content is null or empty, please check if you have provided proper value for the Attachments property within your Office365.SendEmail(...) formula.

 

I have made a test on my side and don't have the issue that you mentioned. The screenshot as below:2947BD4C-D349-4DCB-B59D-849E719FD4B1.jpg

 

5.JPG

The OnSelect property of the Button control set to following formula:

Office365.SendEmail("Test1@xxxxxx.onmicrosoft.com","Send Iamge","This is atest email",{Attachments:Table({Name:"Test.gif",ContentBytes:AddMediaButton1.Media,'@odata.type':""})})

 

The Attachment is a gif picture whose size is 4.45 MB. The version of PowerApps app wihin my Android Mobile Device (Samsung Galaxy C9 Pro) is 3.18061.12, the version of my Android Mobile Device is 7.1.1.

 

Please provide more details about your app's configuration and the issue, so that, we could reproduce your issue on my side and provide a proper workaround for you.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jschudel
Level: Powered On

Re: New Bug: Sending Email with attachment doesn't work in mobile

Thanks for your test and response. Here's the main error message:
 
file-5b.jpg
 
 
And here's what my code is doing, specifically (across multiple screens):
 
1) Retrieve all emails with attachments from Outlook inbox, save to local collection:
   ClearCollect(EmailList,Office365.GetEmails({fetchOnlyUnread:false,searchQuery:"hasattachments:yes",top:10}))
 
2) Display that local collection of emails in gallery for user to select one. Set the ID of the email selected to a local variable, MyEmailID:
   Set(MyEmailID,ThisItem.Id)
 
3) Retrieve all attachments from that email, and save to local collection. I have verified that in the desktop version, this does indeed save down the ContentBytes data:
   ClearCollect(AttachmentList,Office365.GetEmail(MyEmailID,{includeAttachments:true}).Attachments)
 
4) Allow the user to remove unneeded attachments from the local collection. If they click the delete button on an attachment in a gallery displaying the collection, this happens: 
   RemoveIf(AttachmentList,Id = ThisItem.Id)
 
5) To send the new email with these attachments, this code is executed as an OnSelect action for a button. It first makes sure the local collection is not empty. If it is empty, it sends an email without attachment:
   If(And(FileSubmission="Email attachment",Not(IsEmpty(AttachmentList))),Office365.SendEmail(SendTo@email.com,"Subject line","Body text",{Cc:CCTo,Bcc:"jschudel@email.com",Attachments:AttachmentList,IsHtml:true}),Office365.SendEmail(SendTo@email.com,"Subject line","Body text",{Cc:CCTo,Bcc:"jschudel@email.com",IsHtml:true}))
 
As I said earlier, on a desktop, this works perfectly. However, on an iPhone, iPad, or Android, I get this error message. I've tested this with multiple attachment sizes. Occasionally, very small attachments work (under 1-2 MB), but anything over 2MB always fails.
 
I'm wondering if the ContentBytes data is not downloading or transferring completely, even though the "loading" seems to complete after step 3 above. Maybe my check in step 5 is not enough? Or not worded correctly? If I could do a check on whether the ContentBytes is empty for any of the items, maybe that would help, but I'm not sure how to do that.
jschudel
Level: Powered On

Re: New Bug: Sending Email with attachment doesn't work in mobile

I don't understand, I posted a long reply yesterday with details and it's not showing up here... If it still doesn't appear in a minute, I'll try to repost.

jschudel
Level: Powered On

Re: New Bug: Sending Email with attachment doesn't work in mobile

Thanks for your test and response. Here's the original error message:file-5b.jpg

 


This message was from an iPad, but I was also getting the same thing on my Android. We were running PowerApps build 3.18061.12, and my Android version is 4.4.2 (Samsung Galaxy s4 mini).
 
Today, we resaved with the current PowerApps build 3.18062.23. We're seeing the same error on the IPhone/iPad, but the Android throws a different error everytime we try to download or transfer email attachments over 2MB per file. This actually doesn't prevent the email from being sent, just excludes any attachments. (But the iPad/iPhone still won't send the email.) Here is the newest error message from Android:
2018-06-19 23.46.13.png

 

 
 
 
 
And here's what my code is doing, specifically (across multiple screens):
1) Retrieve all emails with attachments from Outlook inbox, save to local collection:
   ClearCollect(EmailList,Office365.GetEmails({fetchOnlyUnread:false,searchQuery:"hasattachments:yes",top:10}))
 
2) Display that local collection of emails in gallery for user to select one. Set the ID of the email selected to a local variable, MyEmailID:
   Set(MyEmailID,ThisItem.Id)
 
3) Retrieve all attachments from that email, and save to local collection. I have verified that in the desktop version, this does indeed save down the ContentBytes data:
   ClearCollect(AttachmentList,Office365.GetEmail(MyEmailID,{includeAttachments:true}).Attachments)
 
4) Allow the user to remove unneeded attachments from the local collection. If they click the delete button on an attachment in a gallery displaying the collection, this happens: 
   RemoveIf(AttachmentList,Id = ThisItem.Id)
 
5) To send the new email with these attachments, this code is executed as an OnSelect action for a button. It first makes sure the local collection is not empty. If it is empty, it sends an email without attachment:
   If(And(FileSubmission="Email attachment",Not(IsEmpty(AttachmentList))),Office365.SendEmail(SendTo@email.com,"Subject line","Body text",{Cc:CCTo,Bcc:"jschudel@email.com",Attachments:AttachmentList,IsHtml:true}),Office365.SendEmail(SendTo@email.com,"Subject line","Body text",{Cc:CCTo,Bcc:"jschudel@email.com",IsHtml:true}))
 
As I said earlier, on a desktop, this works perfectly. It's only on mobile devices, with individual attachment sizes greater than 2MB, where this is an issue. (The total size of all attachments can be greater than 2MB.)
 
I'm wondering if the ContentBytes data is not downloading or transferring completely, even though the "loading" seems to complete after step 3 above. Is there something else I can do?
 
I have tried modifying the steps above by (1) not saving the attachments down to a collection and (2) using the Office365.GetEmail call directly in the Office365.SendEmail call: 
If(And(FileSubmission="Email attachment",Not(IsEmpty(AttachmentList))),Office365.SendEmail(SendTo@email.com,"Subject line","Body text",{Cc:CCTo,Bcc:"jschudel@email.com",AttachmentsSmiley Surprisedffice365.GetEmail(MyEmailID,{includeAttachments:true}).Attachments,IsHtml:true}),Office365.SendEmail(SendTo@email.com,"Subject line","Body text",{Cc:CCTo,Bcc:"jschudel@email.com",IsHtml:true}))
 
This basically has the same result, just delays the Android error message until that final step (whereas it appears in step 3 otherwise).
Todd_tuyen18
Level: Powered On

Re: New Bug: Sending Email with attachment doesn't work in mobile

I'm currently having this issue as well, has there been any response or solution yet?

MarinaSE1996
Level: Powered On

Re: New Bug: Sending Email with attachment doesn't work in mobile

Hii!! Have you got the solution? I have the same problem...

HelloWorld1
Level: Powered On

Re: New Bug: Sending Email with attachment doesn't work in mobile

Hello,

 

I am using Meeting Capture and I have recieved this error as well today. I got the error in the browser (IE) and as well in Microsoft Teams with Meeting Capture added as a tab in our general channel. I have been digging through Meeting Capture trying to find the specific code that exports attachements to emails. Funny thing is Meeting Capture worked perfectly just a month ago. Is this thread still alive or does anyone from Microsoft have an idea what could cause this issue? Thanks for your time. I attached a screen shot as a reference.

 

HelloWorld1
Level: Powered On

Re: New Bug: Sending Email with attachment doesn't work in mobile

Replying to myself but only once I promise (lol). What stands out to me the most in the error message of course is subject cannot be missing or null. I don't see where on the export screens in Meeting Capture it is designating a subject. Wouldn't just take the meeting title as the subject?

Administrator
Administrator

Re: New Bug: Sending Email with attachment doesn't work in mobile

Hi @HelloWorld1 thank you for your post! 

 

Take a look at the following thread and let me know if it helps your issue:

 

https://powerusers.microsoft.com/t5/General-Discussion/Where-is-the-code-in-the-meeting-capture-to-s...

 

@TopShelf-MSFT

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 194 members 5,373 guests
Please welcome our newest community members: