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 / Email with attachments...
Power Apps
Answered

Email with attachments office365V2

(0) ShareShare
ReportReport
Posted on by 216

Hi all,

I have this code working well:

Office365Outlook.SendEmailV2("myname@misite.com","Subject-"&DataCardValue11_2.Selected.Value&"-"&DataCardValue12_2.Text,"Sub2-:-"&DataCardValue11_2.Selected.Value&""&"<br>"&"<br>"&"DATE-:-"&DataCardValue10_2.SelectedDate&""&"<br>"&""&"<br>"&"Sub3-:-"& DataCardValue12_2.Text&""&"<br>"&""&"<br>"&"Sub4-:-"& DataCardValue13_2.Text &""&"<br>"&""&"<br>Sub5----:"& DataCardValue14_2.Text &""&"<br>"&""&"<br>"&"Sub6-:-"& DataCardValue15_2.Text &""&"<br>"&"<br>"&"Sub7-:-"& DataCardValue16_2.Text&""&"<br>"&"<br>"&""&"Sub7"&""&"<br>"&User().FullName)  &""&"<br>"&"{Attachments:AddColumns(RenameColumns(EmlAtt.Attachments ,"&" "Value" "&" ContentBytes")&""& "@odata.type"&""& "")})

 

Now I want to include attachment bit and code is in RED , but gives me errors and can't figure out what am I doing wrong...

Please help...

 

PS: EmlAtt is the attachment control

 

Categories:
  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @K369 

     

    Office365Outlook.SendEmailV2(
     "stalin@ltiblogs.onmicrosoft.com",
     "Test",
     "Test Body",
     {
     Attachments: AddColumns(
     RenameColumns(
     DataCardValue9.Attachments,
     "Value",
     "ContentBytes"
     ),
     "@odata.types",
     ""
     ),
     Importance: "Normal"
     }
    );

     

    StalinPonnusamy_0-1628963264316.png

     

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @K369

     

    I tested with & and <be> and all works fine. Please format the code one by one and we can validate the error.

    Office365Outlook.SendEmailV2(
     EmailAddressDataCard.Text,
     "Subject-" & PNCard.Text & "-" & "DataCardValue12_2.Text",
     DataCardValue10.Text & "<br>" & "This should be next line",
     {
     Attachments: AddColumns(
     RenameColumns(
     DataCardValue9.Attachments,
     "Value",
     "ContentBytes"
     ),
     "@odata.types",
     ""
     ),
     Importance: "Normal"
     }
    );

     

  • K369 Profile Picture
    216 on at

    Thanks StalinPonnusamy 

    That's true. The code given by you will work in its simple form.

    However with bit of <br> I really don't know how to proceed after FullName in my code. Please help

     

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @K369

     

    Looks issue after the .FullName. Please try this

    Office365Outlook.SendEmailV2("myname@misite.com","Subject-"&DataCardValue11_2.Selected.Value&"-"&DataCardValue12_2.Text,"Sub2-:-"&DataCardValue11_2.Selected.Value&""&"<br>"&"<br>"&"DATE-:-"&DataCardValue10_2.SelectedDate&""&"<br>"&""&"<br>"&"Sub3-:-"& DataCardValue12_2.Text&""&"<br>"&""&"<br>"&"Sub4-:-"& DataCardValue13_2.Text &""&"<br>"&""&"<br>Sub5----:"& DataCardValue14_2.Text &""&"<br>"&""&"<br>"&"Sub6-:-"& DataCardValue15_2.Text &""&"<br>"&"<br>"&"Sub7-:-"& DataCardValue16_2.Text&""&"<br>"&"<br>"&""&"Sub7"&""&"<br>"&User().FullName,
     {
     Attachments: AddColumns(
     RenameColumns(
     DataCardValue9.Attachments,
     "Value",
     "ContentBytes"
     ),
     "@odata.types",
     ""
     ),
     Importance: "Normal"
     }
    )

     

  • K369 Profile Picture
    216 on at

    User().FullName)   , {Attachments

    The comma in red is the only error it shows now with remarks " Unexpected characters. Characters are used in the formula in an unexpected way."

     

  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @K369 

     

    In the below code, Just only change to your email and try it.

    Office365Outlook.SendEmailV2(
     "stalin@ltiblogs.onmicrosoft.com",
     "Subject-" & "DataCardValue11_2.Selected.Value" & "-" & "DataCardValue12_2.Text",
     "Sub2-:-" & "DataCardValue11_2.Selected.Value" & "" & "<br>" & "<br>" & "DATE-:-" & "DataCardValue10_2.SelectedDate" & "" & "<br>" & "" & "<br>" & "Sub3-:-" & "DataCardValue12_2.Text" & "" & "<br>" & "" & "<br>" & "Sub4-:-" & "DataCardValue13_2.Text" & "" & "<br>" & "" & "<br>Sub5----:" & "DataCardValue14_2.Text" & "" & "<br>" & "" & "<br>" & "Sub6-:-" & "DataCardValue15_2.Text" & "" & "<br>" & "<br>" & "Sub7-:-" & "DataCardValue16_2.Text" & "" & "<br>" & "<br>" & "" & "Sub7" & "" & "<br>" & User().FullName,
     {
     Attachments: AddColumns(
     RenameColumns(
     EmlAtt.Attachments,
     "Value",
     "ContentBytes"
     ),
     "@odata.types",
     ""
     ),
     Importance: "Normal"
     }
    )

     And we will replace datacard value later

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @K369 

     

    For the above, here is the email

    StalinPonnusamy_0-1628965185673.png

     

  • Verified answer
    K369 Profile Picture
    216 on at

    The issue is still the same. Thank you very much taking time to help me. 

    The moment I get ) after FullName all the errors go away but , Comma after that is in red. Let me try again

     

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 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard