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

Announcements

News and Announcements icon
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:
  • Verified answer
    WarrenBelz Profile Picture
    156,576 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard