web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error with Office365Ou...
Power Apps
Answered

Error with Office365Outlook.SendEmailV2() Invalid value for "to" parameter

(0) ShareShare
ReportReport
Posted on by 4

Hey there, I'm having an issue with an app we created about a year ago, it's been functioning fine until recently, where we have been getting the "Office365Outlook.SendEmailV2() Invalid value for "to" parameter" error. The email does fail to send as it states. I'm not sure if anyone else is seeing this issue, or if some Microsoft change has happened to this function. Below is the code we have been using.

 

If(
DataCardValue45.Selected.Value = "removed",
Office365Outlook.SendEmailV2(
If(
DataCardValue5.Selected.Value = "removed2",
"user1@domain.com",
If(
DataCardValue5.Selected.Value = "removed3",
"user2@domain.com"
)
),
"New D365 Item Number Generated: " & DataCardValue1,
"A new D365 Item Number has been generated, " & DataCardValue1 & ". Please continue the process.",
{Cc: "user@domain.com"}
),
Office365Outlook.SendEmailV2(
If(
DataCardValue5.Selected.Value = "removed",
"user1@domain.com",
If(
DataCardValue5.Selected.Value = "removed2",
"user2@domain.com"
)
),
"New D365 Item Number Generated: " & DataCardValue1,
"A new D365 Item Number has been generated, " & DataCardValue1 & ". Please continue the process.",
{Cc: "user@domain.com"}
)
);
SubmitForm(Form1);
Back()

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Hi @JoeEllis ,

    Try shifting the logic outside the outlook code

    With(
     {
     wUser:
     Switch(
     DataCardValue5.Selected.Value,
     "removed2",
     "user1@domain.com",
     "removed3",
     "user2@domain.com"
     )
     },
     If(
     DataCardValue45.Selected.Value = "removed",
     Office365Outlook.SendEmailV2(
     wUser,
     "New D365 Item Number Generated: " & DataCardValue1,
     "A new D365 Item Number has been generated, " & DataCardValue1 & ". Please continue the process.",
     {Cc: "user@domain.com"}
     )
     )
    );
    SubmitForm(Form1);
    Back()

     

    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.

    Visit my blog Practical Power Apps

  • JoeEllis Profile Picture
    4 on at

    That worked great, thank you!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard