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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,188)