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

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?

12 REPLIES 12
Administrator
Administrator

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

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

Community Support Team
Community Support Team

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

Hi @tomgardzinski,

 

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
Level 8

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

I got the same issue but was gone yesterday.
tomgardzinski
Level: Powered On

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

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.

dhock
Level: Powered On

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

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.

tomgardzinski
Level: Powered On

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

  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.
dhock
Level: Powered On

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

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.

dhock
Level: Powered On

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

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.

tomgardzinski
Level: Powered On

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

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
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

Top Kudoed Authors
Users Online
Currently online: 65 members 3,338 guests
Please welcome our newest community members: