As per the following post, I can send emails with attachments directly from Power Apps using the Office365Outlook connector and SendMailV2 action:
Solved: send image via email - Power Platform Community (microsoft.com)
I would like to do the same but using the Mail connector instead (so that the email does not need to come from the logged in user and so I do not need to maintain a separate Flow). Has anyone managed to get that to work?
It appears that the Mail connector has slightly different parameters and instead of accepting a single Attachment parameter (with the filenames and files in tabular format) it accepts a two parameters, one for files and one for filenames Mail - Connectors | Microsoft Docs
Working code for Office365Outlook.SendMailV2:
ClearCollect(colAttachments, AddColumns(ShowColumns(colImages,"Url"),"Name","attachment.jpg","ContentBytes",Url,"@odata.type",""));
Office365Outlook.SendEmailV2(
emailRecipients,
"New Infringement Details",
emailBody,
{Attachments: colAttachments}
);
Solved! Go to Solution.
Hi @PaulD1 ,
This connector does have these disadvantages.
It seems that it can only send one attachment at a time. And it has throttling limits (no more than 5 emails in a 5 minute period).
Therefore, using Outlook Connector will be more suitable for you.
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.
Hi @PaulD1 ,
I did the test for you and it worked.
If you use list attachments as email attachments, you could try to use the value property of the attachment.
1\ Add a button control and set its onselect property to:
Mail.SendEmailV3("email","test","test",true,{filenames:"test2.jpg",files:First( First(LIST106).Attachments).Value})
In addition, you could also use base64 as the attachment content.
2\ Add a button control and set its onselect property to:
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.
Thanks very much @v-xiaochen-msft - ideally I want to ability to send multiple attachments with the email and that pattern looks like it will only send the one. Also my images are in a collection and not stored as an Attachment.
That said, I've done a bit more reading on the Mail connector and it appears that is it now being heavily throttled (no more than 5 emails in a 5 minute period) so I may have to go down the Flow with OfficeOutlook connector after all 😞
Hi @PaulD1 ,
This connector does have these disadvantages.
It seems that it can only send one attachment at a time. And it has throttling limits (no more than 5 emails in a 5 minute period).
Therefore, using Outlook Connector will be more suitable for you.
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.
Thanks for the confirmation @v-xiaochen-msft .
Yep, given the throttling and attachment limitations of the Mail connector I'll go with plan B of utilizing the Office365Outlook connector through Flow instead (I was trying to avoid dependence on Flow but that does not seem to be possible in this case).
User | Count |
---|---|
157 | |
93 | |
78 | |
73 | |
57 |
User | Count |
---|---|
202 | |
166 | |
98 | |
94 | |
79 |