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 Apps
Unanswered

Email Attachment

(0) ShareShare
ReportReport
Posted on by 583

All,

 

I have tried this a couple ways and I'm not having any luck. I have a NewForm to add to a datasource in a SharePoint list with attachments. I also need to be able to send this data as an email without using a flow and without using the Outlook connector. So what I need is when the form submit button is pressed I also need it to do the following, Mail.SendEmailV3("emailaddress","subject",HtmlText1.HtmlText,true,{filenames:attachmentname,files:attachment}) but I can't get the attachment part to work.

 

Any help is greatly appreciated.

Categories:
I have the same question (0)
  • Powerplatform01 Profile Picture
    386 on at

    You can watch this video to resolve your issue

    https://youtu.be/GA_f5GX5H-Q

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    Hi @StephenGW 

    Let's suppose we take a SharePoint record with file attachments. If we add a card to a detail form, the syntax to add the file attachments to an email message looks like this:
     
    Office365Outlook.SendEmailV2(
    "Name@emicrosoft.com",
    "Email Subject",
    "Email Body",
    {
    Attachments: RenameColumns(
    ThisItem.Attachments,
    "Value",
    "ContentBytes",
    "DisplayName",
    "Name"
    ),
    Importance: "Normal"
    }
    )
  • StephenGW Profile Picture
    583 on at

    @Powerplatform01 

     

    As mentioned in my post I would like to avoid using Flow. I need the email to be fully translatable into other languages and the best way I found to do that is to build the email in HTML in the app. Also I need every entry in the app form to go to the SharePoint list but only some conditions will send an email.

  • StephenGW Profile Picture
    583 on at

    @Ramole 

     

    I could not get this to work with the Mail connector as I stated I cannot use the Outlook connector. Do you know how to do this with the Mail connector?

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    Hi @StephenGW 

     

    Sorry I never used Mail connector but try this please 

     

    Mail.SendEmailV3("Name@microsoft.com", 
     "Enter the email title here", 
     "Enter your email message here",
     false,
     {
     files:First(ThisItem.Attachments).Value,
     filenames:First(ThisItem.Attachments).DisplayName
     }
    )

     

     

  • timl Profile Picture
    36,749 Super User 2026 Season 1 on at

    Hi @StephenGW 

    You might be interested in my blog post here, which describes the syntax that @Ramole mentions and explains how to use the Mail connector in more detail.

    http://powerappsguide.com/blog/post/when-and-how-to-use-mail-connector

    In your case, since you want to send your message on the submission of a new record, you would add the following formula to the OnSuccess property of your form. LastSubmit.Attachments provides access to the attachments.

    Mail.SendEmailV3("tim@emailaddress.com", 
     "New record - Files", 
     HtmlText1.HtmlText,
     true,
     {
     files:First(Form1.LastSubmit.Attachments).Value,
     filenames:First(Form1.LastSubmit.Attachments).DisplayName
     }
    )

     

  • StephenGW Profile Picture
    583 on at

    @timl and @Ramole 

     

    When I put this in my form(Form2) it gives me an error.

     

    Mail.SendEmailV3("email@email.com",
    DataCardValue21.Text,
    HtmlText1.HtmlText,
    true,
    {
    files:First(Form2.LastSubmit.Attachments).Value,
    filenames:First(Form2.LastSubmit.Attachments).DisplayName
    }
    )

     

    Both the Files and Filenames have errors, the filenames says its expecting text but using an Error type. Same for the files, expecting Blob and using Error type.

     

    The attachment data card uses an IF to make it required based on another data card if that might be causing it.

     

    Any ideas on this?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 545 Most Valuable Professional

#2
Haque Profile Picture

Haque 314

#3
Kalathiya Profile Picture

Kalathiya 234 Super User 2026 Season 1

Last 30 days Overall leaderboard