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

How to send emails from PowerApps as a different user?

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?

 

2 REPLIES 2
Bochie
Resolver I
Resolver I

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

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.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,511)