web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Office365Outlook.SendE...
Power Apps
Unanswered

Office365Outlook.SendEmailV2() function with default attachment

(0) ShareShare
ReportReport
Posted on by 48

I have a "default.pdf" file that is saved in a folder on my sharepoint.

In powerapps I use the Office365Outlook.SendEmailV2() function to send emails to users. Is it possible to make this function send always this "default.pdf" attachment that is in my sharepoint too, whenever it send a new email?

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,833 Super User 2026 Season 2 on at

    Hi @nok ,

     

    Yes this is possible by passing the optional attachments parameter , but there's a trick to it:

    Office365Outlook.SendEmailV2(
     "user@email.com", //replace with a reference to the recipients
     "Subject", //replace with a reference to the subject
     "Body", //replace with a reference to the email body
     {
     Attachments: 
     {
     ContentBytes: First(AttachmentControl.Attachements).Value,
     Name: First(AttachmentControl.Attachements).Name
     }
     }
    );

     

    As you can see this refers to an AttachmentControl. To get one of these, you need to add a form to your app and then copy the control from there. Delete the formulas for any properties that give you errors, rename the control to AttachmentControl and then set the Items property to:

    LookUp(
     LibraryName, //replace with the name of your library
     'File name with extension' = "default.pdf"
    ) 

     

    After this, hide the attachment control by setting its' Visible property to false.

  • cwebb365 Profile Picture
    3,294 Most Valuable Professional on at

    To my knowledge, you have to use a flow to accomplish this, so you might as well use the send e-mail action in flow to handle everything, just pass the data needed for it form PowerApps. 

     

    However, that said, I would recommend approaching it differently, as I don't like attaching files / templates to e-mails as it can fill up inboxes etc. and not a best practice. Getting a Share link with Everyone permissions and putting a link to download the template might be a better option, and you wouldn't need to use a flow in that case. Most people will be downloading the document somewhere to make changes and resend anyway, you can save them the space in the inbox. 

     

     

  • nok Profile Picture
    48 on at

    Hi, @BCBuizer 
    I created all these steps that you said, but when I ran the send email function, the email is not sent and the following error returns:
    er1.png


    And in my AttachmentControl the attachment appears without a name, even though its name is correct in LookUp().
    er2.PNG

    What do you think it could be?

  • cwebb365 Profile Picture
    3,294 Most Valuable Professional on at

    Don't think you can do this with SharePoint due to the way the URL's / Security works. You have to point the contentbytes to a public URL you can GET directly from. Like a azure Blob link or something similar. In order to send it with the connector. 

  • cwebb365 Profile Picture
    3,294 Most Valuable Professional on at

    It's due to the security, hence why everyone uses a flow to return the raw contentbytes back to PowerApps from a Flow. See this post. The section with the file content, same thing, you would have to call a flow to return the bytes. 
    Power Apps View A PDF Stored In A SharePoint Document Library (matthewdevaney.com)

    Or you have to put your file somewhere besides SharePoint behind a direct link, not behind redirect or security, aka a azure blob link or something similar that's open on the internet that the connector can directly access from your app. 

  • BCBuizer Profile Picture
    22,833 Super User 2026 Season 2 on at

    Hi @nok ,

     

    I must have mixed up things with with SP list attachments.

     

    Please try @cwebb365 's suggestion.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard