Hi,
I have a use case that I want to email to be send from current user id who have created the item.
From address in the email should be the current user email.
can you please advice how to achieve the same.
Thanks in advance.
Solved! Go to Solution.
If you are using an automated trigger then the flow is running in the security context of the maker. To use a different email address to send an email the maker account would need to have "Send as" or "Send on Behalf of" permission to that mailbox. If there are only one or two from accounts that is possible. But if there are a lot of possibilities it becomes very hard to manage and is impractical. There is no workaround.
Which of those triggers are you using?
Hi @Pstork1
Thanks for the response.
I am using automated trigger , in send email action if I configure Created by email in "Send As" section it throws the following error "You are not authorized to send mail on behalf of the specified sending account."
If you are using an automated trigger then the flow is running in the security context of the maker. To use a different email address to send an email the maker account would need to have "Send as" or "Send on Behalf of" permission to that mailbox. If there are only one or two from accounts that is possible. But if there are a lot of possibilities it becomes very hard to manage and is impractical. There is no workaround.
Hi @Pstork1
There will be lot of possibility in the email address so I will opt for PowerApps button trigger then.
And one more query , how to pass multiple value selected in Combo box people picker field form PowerApps to TO address in Power Automate send email action through button trigger.
1) Here's the code for in Power Apps on the button.
ClearCollect(myemails,ComboBox1.SelectedItems);
SendEmail.Run(JSON(myemails,JSONFormat.Compact),User().Email);
Create a collection from the SelectedItems in the Combobox. Then use JSON() to translate that collection into a JSON formatted array as a parameter.
2) Then in the flow. Add a Parse Json action to parse the collection array you send as a parameter. Since its an array you'll need an apply to each to get the emails into a semicolon delimited string variable. Use that variable for the To:
Details
@Pstork1 I have gotten the User().Email into the flow, so I can just use it as the sender? IT will be recognized as a connection?
Since the flow is triggered from Power Apps, you can use the email from the user triggering the flow in the SendAs field of the email.
Do you by any chance know if this is the same for if the flow is triggered instantly from a business process flow? I have a sense it should follow the same logic. @Pstork1
No, flows that are triggered automatically will run in the context of the original maker. To use a different address in the From field requires that the maker has Send As permission to that mailbox.
@Pstork1 I see, its considered an automatic flow even if the person has to click a button to execute it in the business process flow.
Apologies for the Swedish, its buttons that are the initiations of the flow:
Which means we can get the ID of the person triggering it. But there might be an ambiguous line here of what is an automated and an instant.
In this case the trigger is an automated trigger because its being triggered from Dataverse. When you click a button in Power Apps that is considered a manual trigger. The one I think you want is the following. Is a manual trigger and should run in the context of the person running the business process.
I have this question too, I wonder if you can help with this scenario?
I have a cloud flow which passes data from a form to an approval process if approved, an email is sent to one supplier (and asana tasks are also created in other conditions).
I'd like to send from the person who created the form (this can only be done by users within our Microsoft 365 Environment). At the moment I can only send from me as I created the flow, but this clearly isn't ideal for lots of users.
Can you suggest how I could adjust this?
Since this is using an automated trigger for when a form is submitted you can't send an email as the person who created or filled out the form unless you have "Send as" permission to their mailbox.
@lwt-hot you can create a user that does all emailing and name it something neutral and appropriate and then use that mail as sender. In the email you can write on behalf of [user that triggered the flow] and if they need to respond they should do so to their address. You can send a hidden copy to the user.
It might not be ideal though... And using getting permission on mailbox is better. I am myself debating about these options.
Just to clarify what @shavora said. Using a neutral account (a service account) will work, but you then need to create the flow using that account as the maker or obtain "Send As" permission to that one mailbox so you can use it in the From.
Yeah, share as owner to a service account has worked for me. And then I added the reference connection for that service account on the email action.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
User | Count |
---|---|
4 | |
3 | |
2 | |
2 | |
1 |
User | Count |
---|---|
10 | |
10 | |
6 | |
6 | |
5 |