cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

Error sending two emails on form submit

Upon submitting of a form I'm sending two emails.  One goes out for all submits and a second one goes out if a condition is true.  I can send each of them individually if I comment out the other one but when I try to have them both run, I get an error,

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

 

Do they need to be separated differently?  Can you send two emails from one submit?

Here's my code....

 

Send Email 1.jpgSend Email 2.jpg

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you @DavesTechTips.  Setting of variables on all the fields in the email worked great.  I tried just setting the SSMDropdown.Selected.Email to a variable but then the rest of my fields turned up blank in the email.  Once I set them all to variables and plugged them into the email, they all worked.

Also, thank you for pointing out the Concurrent function.  This is my first app and that function should come in handy in other places.

Thank you!

View solution in original post

3 REPLIES 3
Super User II
Super User II

Hi @taramoe

 

Yes you should be able to send two mails on submit. Are you using a form? Just make sure that no fields are reset before generating the second mail.

 

Some other thoughts:

a) Maybe try setting a variable at the beginning of the formula with the value of SSMDropdown.Selected.Email and send mail to this variable to make sure that the value of the field is not being reset in the submit somehow.

b) Consider using Concurrent to send both at the same time for speed purposes.

c) Maybe send us the entire formula as the below screen prints seem to be extracts of the formula.

 

twitter: @dawidvh

youTube: https://www.youtube.com/channel/UCIMe_ErQZP5chbI9UyW0xLw

>>If you found this reply helpful, please mark this as the answer to close the topic and make it easier to find for other people with similar questions.<<

 

 

Maybe you should send us the entire piece of code as

Thank you @DavesTechTips.  Setting of variables on all the fields in the email worked great.  I tried just setting the SSMDropdown.Selected.Email to a variable but then the rest of my fields turned up blank in the email.  Once I set them all to variables and plugged them into the email, they all worked.

Also, thank you for pointing out the Concurrent function.  This is my first app and that function should come in handy in other places.

Thank you!

View solution in original post

I am very glad to hear that you came right.

 

Have fun with the rest of the many cool features of PowerApps.

 

Have a great day!

 

twitter: @DavesTechTips

youTube: https://www.youtube.com/channel/UCIMe_ErQZP5chbI9UyW0xLw

>>If you found this reply helpful, please mark this as the answer to close the topic and make it easier to find for other people with similar questions.<<

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (12,425)