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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Send email 365 when at...
Power Apps
Unanswered

Send email 365 when attach a image (Office365Outlook.SendEmail)

(0) ShareShare
ReportReport
Posted on by

I have an error using this function

 

Office365Outlook.SendEmail("mail","Topic","Body",{IsHtml: true,Importance: "High",Attachments: {Name:"photo.jpg",ContentBytes: FotoIMG.Image,'@odata.type': ""}});

 

It was working normal and suddenly I got the error of the attached image.

 

Thanks

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at

    Hi @Anonymous ,

    Try the below and see if it makes a difference.

    ClearCollect(
     colImage,
     {
     Name:photo.jpg", 
     ContentBytes:FotoIMG.Image, 
     '@odata.type':""
     }
    );
    Office365Outlook.SendEmail(
     "mail",
     "Topic",
     "Body",
     {
     Attachments:colImage, 
     IsHtml:true
     }
    )

     

    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.

  • v-bofeng-msft Profile Picture
    on at

    Hi @ JesusAguirre19:

    I made a test, But did not encounter the problem you described.

    Based on your screenshot, I think the problem is "ContentBytes: FotoIMG.Image"

    Could you tell me what FotoIMG is? What is the definition of FotoIMG?

    I suggest you check  "ContentBytes: FotoIMG.Image" in this way:

    Add a image control and set its image property to FotoIMG.Image.

    In addition, I wrote a formula for you to test(It will most likely not take effect until you solve the above problem).

    Office365Outlook.SendEmailV2(
     "mail",
     "Topic",
     "Body",
     {
     Attachments: Table(
     {
     Name: "photo.jpg",
     ContentBytes: FotoIMG.Image,
     '@odata.type': ""
     }
     ),Importance:"High"
     }
    )

     

    Best Regards,

    Bof

  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at

    Hi @Anonymous ,

    When you respond to mine, the next place we have to look is the components as noted by @v-bofeng-msft 

  • Community Power Platform Member Profile Picture
    on at

    Hi!

     

    I already tried with both methods and it keeps giving me the same error in the image, I tried the same code that I have in another app and there if it is working correctly for me.

     

    Because in the before version works correctly.

     

    Any other ideas to solve the problem??

    @WarrenBelz @v-bofeng-msft 

     

     

  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at

    Hi @Anonymous ,

    I have just tested your exact code to send an email to myself with an image uploaded with the Add Picture Control and it worked perfectly, so what in your model is FotoIMG.Image ?

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    Hi @WarrenBelz 

     

    I already found the problem, it was because the image is inserted in a format other than base64 (octet-stream). It needs to be in base64 / jpg or png format to be able to send it correctly by mail.

     

    Regard and thanks for your comments. 

    @v-bofeng-msft 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard