cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Oliver_McErlane
Helper I
Helper I

Using "Send an Email (V2)" from a Flow triggered by a PowerApps form

Hi,

 

I have a PowerApps form which when submitted should add to a SharePoint list and send an email alert from a generic email account. 

When I put it into the one Flow, It breaks at the send email part, even though the connector is the account from where the email is sent. see screenshot below..

You are not authorized to send mail on behalf of the specified sending account.
clientRequestId: 1240cbe3-4bc5-4dfb-ae08-cd36f5734eb8
serviceRequestId: 9f4c62f1-9ebc-4736-80fc-ab0d25dd4275

 

I can get this to work by splitting out into 2 Flows.

The first triggered when the form is submitted creates the SharePoint list item.

The second triggered when a new Item is added to the SharePoint list successfully sends the email from the generic account. 

 

Can this not be done all within the one Flow? 

 

Thank you for your time,

Ollie

 

Oliver_McErlane_0-1595436187020.png

 

3 REPLIES 3
Pstork1
Dual Super User III
Dual Super User III

The problem is that when you trigger the flow from Power Apps that flow now runs in the security context of the person who triggered the flow.  That means the email will be sent from the mailbox of the person triggering the flow in Power Apps.  That is why you are getting the error.  When you run the flow automatically upon creation of an item it runs in the security context of the original maker.  Since you as the maker have access to the mailbox you are able to send it from the generic address.  Splitting it into two flows is the only realistic way to get around your issue.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi @Pstork1 ,

 

Do you know if there is a way around this so even if submitted via powerapps user, the email still sends from the connected account?

 

Im aware i can use the  'send on behalf of' feature within 'send an email v2', however i believe that would involve adding each user individually as you cannot set 'everyone' in the organisation to be able send on behalf of a shared mailbox by default?

 

Can you see a simple way around this, or am i going to have to add every user individually to be able to send on behalf of the mailbox in question?

 

Thanks in advanced

 

Nick

Pstork1
Dual Super User III
Dual Super User III

Other than 'Send on Behalf of" permission, which I agree is not practical in this case, there is no simple workaround.   A flow started from Power Apps will always run in the context of the user who started the flow, so that is the mailbox that will be used to send the email.  There is no way to change that behavior.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,719)