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

Send Emails Dynamically

Hi Community Members,

 

I am trying a very simple usecase but am unable to crack this error.

 

 

The service returned an error: Office365!SendEmail: The method ‘SendEmail’ has an invalid value for parameter ‘To’

 

 

 

I have a Form which is connected to my sharepoint list. 

 

I ask the user to enter his email address in the form and want to send him a Thank You message for his feedback.

1.jpg

 

Name of the Email Box is DataCardValue2

 

and I have a button to send the email and the formula is 

 

 

Office365Outlook.SendEmailV2(DataCardValue2.Text,"Feedback",HtmlText3.HtmlText)

 

 

 

This throws the error.

 

Please help.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Hi All,

 

Thank You for the help.

 

I got my answer.

 

I was resetting my form and then sending the email. This led to my email not being sent.

 

I changed the code. First sent the email and then reset the form.

 

Regards,

Harsh Nathani

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @Anonymous ,

Does DataCardValue2 contain a valid email address?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi @Anonymous ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

dyee4614
Helper V
Helper V

Here are things that might be wrong:

1- You didn't load the data source office 365.

2- I'm not sure why your code says Outlook.  When I sent myself a test email from PowerApps, the code is 

Office365.SendEmailV2()

3 - I don't think it should be htmltext3.text.  To my knowledge, there is no HTMLTEXT ending

Anonymous
Not applicable

Hi All,

 

Thank You for the help.

 

I got my answer.

 

I was resetting my form and then sending the email. This led to my email not being sent.

 

I changed the code. First sent the email and then reset the form.

 

Regards,

Harsh Nathani

View solution in original post

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,774)