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

Office365.SendEmail failed: The method 'SendEmail' has an invalid value for parameter 'To'

 

sendemail error.JPGI've created an app and it seems to work fine while I'm testing it with my user. I have expanded my testing to other users in my organization and I'm getting the error message as shown to the left.

 

I have ensure that the person who receives this error has "Contribute" access to the sharepoint lists (data sources). I also use test labels as per best practices while devloping a powerapp to ensure the email address is valid before hitting send/submit.

 

Does anyone have any ideas on how to solve this? I'm beginning to think that it is not an issue with how I built the powerapp, but more so something in my system settings or connections.

 

Any thoughts?

13 REPLIES 13
Anonymous
Not applicable

hi @Anonymous I'm adding in @v-micsh-msft to help with this question

v-micsh-msft
Community Support
Community Support

Hi @Anonymous,

 

Would you please let me know the whole formula used in the Office365.SendEmail () ?

 

The message indicates the first Syntax is not in the right format.

 

Please verify the Email address, or the control used to enter the Email Address.

Office365,SendEmail(To, Subject, Body,{Additional FIelds})

For more details, see the documentation:

Office 365 Outlook

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Lisabel0
Helper V
Helper V

I got the same issue but was gone yesterday.
Anonymous
Not applicable

I have opened a ticket with MS to resolve this issue and it has been raised as a high severity bug. Not sure I'll get a technical solution response where I could paste into this thread after.

Stay tuned.

Hi,

Did you ever get an answer from Microsoft on this? I get the same error on a PowerApps form, though the email does still get sent. I just don't want users to see that error and think that there's something wrong. I'm using a label and setting its text to the email address from a person field, and then using the label text as the To value in the Office365.SendEmail action. The label text looks correct and the email itself does get sent.

Thanks.

Anonymous
Not applicable

  1. Create a Flow that dictates what you want to happen after a button is clicked. The action in this case is send an email.
  2. In flow, select “create from template”, search "PowerApps", then click the powerapps button icon with gear.
  3. Click new step, and look for the action “Outlook send email”.
  4. For the “To” field select ask in Powerapps. Complete the subject and body fields with just test information for practice.
  5. Return to powerapps, copy and paste into notepad any current coding in the ONSELECT of the button you wish to tie to the flow.
  6. while the button (trigger) is selected and in its ONSELECT properties, click “Action” at top menu bar, then “Flows”
  7. Select the flow you just created.
  8. It will then prompt you to put in a ‘To’. You can use a datacardvalue from your form.
  9. Review what you've copied and pasted in notepad to determine what you still need in the coding of ONSELECT, like for example a NAVIGATE function.

Thanks. I just tried this but got the same result when submitting the PowerApps form. It still doesn't like the To parameter. The Flow works, though, and sends the email, but the error still comes up on the PowerApps form.

Looks like the error was due to using the text of a label field for the email address. I switched it to a text field (it's going to be hidden, anyway, because it doesn't get the address from user input but from a formula that uses the output of another formula that compares two table variables -- yes, getting complex) and I did not get the error afterwards. Basically, I set a variable to the value of a multi-select people picker field when the screen becomes visible (to get current selection), then I set another variable to the new value of the people picker (OnChange), compare the two via a filter operation and get new entries and old entries, exclude the current user from both if present, and generate a semicolon-separated string of emails for both cases. All this because I needed to send emails to new assignees and previous assignees for a task.

Anonymous
Not applicable

Hey thats interesting. I am going to be creating an app in the near future where this may be required. Would you be willing to share the coding you are using with all private matters blacked out? if so perhaps you can direct message me if that is possible through the powerapps community.

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.

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 (3,440)