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 / Attachment is not incl...
Power Apps
Unanswered

Attachment is not included while sending mail

(0) ShareShare
ReportReport
Posted on by

Hi PowerApps team,

 

I am facing an issue, I created a form and I set that when the user submits the form. That time it wants to save that form into my SharePoint and also wants to send a mail with an attachment to admin.

 

For this scenario, I used the code in my app. I am getting mail when the user submits the form. But in that mail attachment is not included. 

 

Please review this code and If is there any mistakes or errors. Please reply to this post.

 

SubmitForm('Employee Form_1');
ClearCollect(
RecipientList,
MyPeople.Mail
);
Set(
_emailRecipientString,
Concat(
RecipientList,
Mail,
";"
)
);

Office365Outlook.SendEmail(
"abcd@gmail.com",
"New Referral Submitted for " & JobDataCardValue1_1.Text & " Position",
Concatenate(
"Hi HR Team,",
Char(10),
Char(10),
"I hope this email finds you well. I wanted to inform you that a new referral has been submitted via our referral form.",
Char(10),
Char(10),
"The referral details are as follows:",
Char(10),
Char(10),
"- Name: ",
NameDataCardValue5_1.Text,
Char(10),
"- Position: ",
JobDataCardValue1_1.Text,
Char(10),
"- Referred by: ",
User().FullName,
Char(10),
Char(10),
"Please take the necessary actions to verify the profile and follow up with the candidate accordingly.",
Char(10),
Char(10),
"You can view the referral form in PowerApps here: ",
"https://web.powerapps.com/apps/<AppID>/edit/ReferralForm",
Char(10),
Char(10),
"Thank you for your attention to this matter."
),
{
Importance: "Normal",
Attachments: AddColumns(
            RenameColumns(
                txtemailattach_1.Attachments,
                "Value",
                "ContentBytes"
            ),
            "@odata.type",
            "")
}
);
ClearCollect(
MyPeople,
{Mail: ""}
);

I hope you can help me with this. @vikas1606 @WarrenBelz @iAm_ManCat and others

image.png
Categories:
  • WarrenBelz Profile Picture
    156,576 Most Valuable Professional on at

    Hi @Pavithran ,

    Assuming txEmailAttach_1 is an Attachment control (unusual name for it), try with V2 of the send email - a couple of other suggestions also below

    With(
     {wList: MyPeople.Mail},
     With(
     {
     wTo:
     Concat(
     wList,
     Mail,
     ";"
     )
     },
     Office365Outlook.SendEmailV2(
     wTo,
     "New Referral Submitted for " & JobDataCardValue1_1.Text & " Position",
     "Hi HR Team,<br><br>I hope this email finds you well. 
     I wanted to inform you that a new referral has been submitted via our referral form.
     <br><br>The referral details are as follows:
     <br><br>- Name: " & NameDataCardValue5_1.Text & 
     "<br>- Position: " & JobDataCardValue1_1.Text & 
     "<br>- Referred by: " & User().FullName & 
     "<br><br>Please take the necessary actions to verify the profile and follow up with the candidate accordingly.
     <br><br>You can view 
     <a href='https://web.powerapps.com/apps/<AppID>/edit/ReferralForm'>the referral form in PowerApps here</a>
     <br><br>Thank you for your attention to this matter."
     {
     Attachments: 
     AddColumns(
     RenameColumns(
     txtemailattach_1.Attachments,
     "Value",
     "ContentBytes"
     ),
     "@odata.type",
     ""
     )
     }
     )
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • WarrenBelz Profile Picture
    156,576 Most Valuable Professional on at

    Hi @Pavithran ,

    Assuming txEmailAttach_1 is an Attachment control (unusual name for it), try with V2 of the send email - a couple of other suggestions also below

    With(
     {wList: MyPeople.Mail},
     With(
     {
     wTo:
     Concat(
     wList,
     Mail,
     ";"
     )
     },
     Office365Outlook.SendEmailV2(
     wTo,
     "New Referral Submitted for " & JobDataCardValue1_1.Text & " Position",
     "Hi HR Team,<br><br>I hope this email finds you well. 
     I wanted to inform you that a new referral has been submitted via our referral form.
     <br><br>The referral details are as follows:
     <br><br>- Name: " & NameDataCardValue5_1.Text & 
     "<br>- Position: " & JobDataCardValue1_1.Text & 
     "<br>- Referred by: " & User().FullName & 
     "<br><br>Please take the necessary actions to verify the profile and follow up with the candidate accordingly.
     <br><br>You can view 
     <a href='https://web.powerapps.com/apps/<AppID>/edit/ReferralForm'>the referral form in PowerApps here</a>
     <br><br>Thank you for your attention to this matter."
     {
     Attachments: 
     AddColumns(
     RenameColumns(
     txtemailattach_1.Attachments,
     "Value",
     "ContentBytes"
     ),
     "@odata.type",
     ""
     )
     }
     )
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Pavithran Profile Picture
    on at

    Thanks for replying @WarrenBelz. It is very useful to solve the issue. I found another solution for that. Actually In my code, First I submitted the form and then only I try to send mail. Instead of that, I changed my code to First send mail and then submit. This way gives me a simple solution. Anyway, I got another solution from you @WarrenBelz.

     

    Once again, Thanks for replying🙌

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard