Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 6sZmv0jBzp7YBTUqSzg/5C
Power Apps - Building Power Apps
Unanswered

Office365Outlook.SendEmailV2 From Error: 403

Like (0) ShareShare
ReportReport
Posted on 14 Jun 2022 09:21:15 by 54

Hi,

I used the Office365Outlook data source in PowerApps to send out an email notification based on fields and buttons clicked within a canvas app. I get an error from some individuals, and for some it pushes through correctly.

 

The code I used is something like this.

 

Office365Outlook.SendEmailV2("Email Address Here", "Subject Title Here", "Email Body Here")

 

For some resources, this sends out correctly using their account. However, for one resource, the email account sends using a shared mailbox.

 

I'm thinking it needs to specify which account, and so I tried using "From" inside the code. It looks like this. "varUser.Email" is a variable holding the current user's email.

Office365Outlook.SendEmailV2("Email Address Here", "Subject Title Here", "Email Body Here", {From: varUser.Email})

Again, this works for most users. However, for some, PowerApps returns an error message:

Office365Outlook.SEndEmailV2 failed: {"status":403, "message": "You are not authorized to send mail on behalf of the specified sending account" [...] code: "ErrorSendAsDenied"

 

Is there anything I'm missing? Or anything I should check out? Thank you. Any help is appreciated

Categories:
  • One Profile Picture
    416 on 14 Jun 2022 at 14:29:58
    Re: Office365Outlook.SendEmailV2 From Error: 403

    @noelflores,

    that is why he was asking why you were using From in the first place because the outlook connector will default to the current users email so you shouldn't need to provide a From unless you wanted it to come from something like a shared mailbox. but he was also pointing out that you are creating another separate variable to hold the email when you could just use the following to provide the current users Email:

    User().Email

    {"status":403, "message": "You are not authorized to send mail on behalf of the specified sending account" - This just means that the app tried to send an email from an account the current user doesn't have permission to use. For the first scenario where the email is sending from a shared mailbox, if the user commonly uses the shared mailbox they may have the shared mailbox as their default sender in Outlook. I am not sure if PowerApps is able to overwrite this or not, but it would explain why the emails are being sent from a shared mailbox.

    ------------------------------------------------------------------------------------------------------------------------------
    Please click "Accept as Solution" if this post answered your question so that it is helpful for people having similar questions. If you found this post helpful smack that Thumbs up button! Thanks!

  • nwelflores Profile Picture
    54 on 14 Jun 2022 at 13:26:35
    Re: Office365Outlook.SendEmailV2 From Error: 403

    Hi, I'm actually not specifying a shared mailbox. I used From in response to the first scenario, where on some resources, the email is sent out using a shared mailbox. I wanted to see if I forced the From property, if the app is going to use the logged-in connection instead. 

     

    First Scenario. without From : the result is that email sends out using a shared mailbox,
    Second Scenario, with From : "error message 403"

     

    My hunch is that it is bypassing the logged-in connection and using the user's associated mailbox for some reason.

     

     

     

     

  • One Profile Picture
    416 on 14 Jun 2022 at 12:09:23
    Re: Office365Outlook.SendEmailV2 From Error: 403

    hi @noelflores,

    I agree with @WarrenBelz, it would make sense to use From if you wanted the notification to come from something like a department email rather than an employees work email. however, you will need to make sure people have the proper permissions to access that email group if using this method. otherwise the better route would be to let PowerApps default to the currently logged in user's email. it is automatically used by the Outlook connecter if no From is provided.

  • WarrenBelz Profile Picture
    146,508 Most Valuable Professional on 14 Jun 2022 at 11:46:22
    Re: Office365Outlook.SendEmailV2 From Error: 403

    Hi @noelflores ,

    I have to ask one question here - why are you bothering with From when you are using the user's email - the mail will always come from the logged-in user (their connection is used when they open the app). How are you specifying the Shared Mail Box?

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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,369 Most Valuable Professional

Leaderboard
Loading started