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

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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