cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PaulD1
Super User
Super User

Sending attachments with the mail (not Office365Outlook) connector

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}
    );

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

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.

View solution in original post

4 REPLIES 4
v-xiaochen-msft
Community Support
Community Support

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})

 

 

 

v-xiaochen-msft_0-1618191670555.png

 

In addition, you could also use base64 as the attachment content.

2\ Add a button control and set its onselect property to:

v-xiaochen-msft_1-1618191921450.png

 

 

 

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 😞 

v-xiaochen-msft
Community Support
Community Support

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.

View solution in original post

PaulD1
Super User
Super User

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).

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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