Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Dksz30eScCRo98SVsYv0Ic
Power Apps - Building Power Apps
Unanswered

How to send emails from PowerApps as a different user?

Like (0) ShareShare
ReportReport
Posted on 2 Mar 2022 02:18:38 by 151

I have a simple PowerApp based on a SharePoint Issue Tracker list. When a new item is added I want to send an Email to a group of people notifying the action. However, instead of coming from the user who created the new item, I want the email to look like it's coming from an Email distribution within the company.

 

First up, I created a flow in Power Automate, where an email is sent when a button is pressed in PowerApps. Pretty standard stuff, with only addition being "From (Send as)" set to the email distribution I want the email to look like its coming from. I have made sure that my account has "Send As" permissions to this distribution.

 

Web capture_1-3-2022_1894_us.flow.microsoft.com.jpeg

 

Next, from PowerApps, to the submit button, I added the following code:

SubmitForm(EditForm1);
EMail_Notification.Run(
 varSendTo,
 "New Item Added: " & EditForm1.LastSubmit.Title,
 "EMAIL BODY HERE"
);

 

This works fine when I use my account to create an item, and I get the email as expected. However, when I try with a different user account, the flow fails with the following error message.

You are not authorized to send mail on behalf of the specified sending account.

 

It appears that even though I have the ownership of the flow, the user who clicks the button must also have "Send As" permission to the email distribution in order for this to work. I want all people in my organization to be able to use my app, but obviously I don't want to give everyone the "Send As" permissions to the email distribution.

 

Is there a way for a PowerApp to send email notifications appearing as coming from a certain email address?

 

Categories:
  • DS1060 Profile Picture
    77 on 12 Feb 2024 at 18:55:26
    Re: How to send emails from PowerApps as a different user?

    Used a automate flow with a trigger on modified item

    (on created could work but using created sometime bug or does not trigger and then you cant manualy trigger it).

     

    So to avoid that, i'm using a "List item Modified" trigger with conditional parameter to check a boolean column so it will not trigger for every action on that list item.


    Having a column "MailSent" set to true by the flow once the job is done and set to false form app when you want to send.

     

    As the flow is not triggered by a user, it will use the flow connector's credential.

     

    How to send mail with Power Automate:

    Create flows for popular email scenarios in Power Automate - Power Automate | Microsoft Learn


    How to add parameter to a trigger:
    Power Automate Trigger Conditions made EASY - Power Platform Community (microsoft.com)

     

     

     

     

  • railgun0w0 Profile Picture
    on 30 Nov 2023 at 04:03:38
    Re: How to send emails from PowerApps as a different user?

    For everyone who wants to send an email from a flow creator connection, edit Run only users in your flow will work.

  • Akser Profile Picture
    1,546 Super User 2025 Season 1 on 06 Sep 2022 at 11:46:44
    Re: How to send emails from PowerApps as a different user?

    You should not use PowerApps as the trigger to send out the emails as it will require the specific user that presses the button to have rights on the email. Instead, use the SharePoint list as your trigger. In other words, whenever an item is added to the SharePoint list, start a PowerAutomate. 

  • Stephannos Profile Picture
    3 on 06 Sep 2022 at 11:10:40
    Re: How to send emails from PowerApps as a different user?

    https://youtu.be/Mhr1iqSXf0s

  • SachS Profile Picture
    151 on 02 Mar 2022 at 16:13:51
    Re: How to send emails from PowerApps as a different user?

    Thanks for the reply, but that doesn't quite solve my problem. My account can send on behalf of that email without any issues. My need is for an email to be generated and sent whenever anyone within the organization creates a new item from the PowerApp, and I want the email to look like it's coming form the aforementioned email distribution. 

     

    I can't give everyone in the organization access to a shared mailbox so I'm looking for an alternative.

  • Bochie Profile Picture
    237 on 02 Mar 2022 at 02:38:01
    Re: How to send emails from PowerApps as a different user?

    Hi! If you are sending an email in behalf of someone else, you can only do so if that person has given you permission or assigned you as a delegate to his/her mailbox. I would suggest you use a shared mailbox with you as an authorized sender, that way you can use the "Send an email from a shared mailbox (V2)" action. Hope this helps.

     

    -bochie

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,658 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard
Loading started