Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

How to email a PDF file using SendMail?

Posted on by

Please, can anyone in the community provide a little suggestion on how to email a PDF file using SendMail?

 

Button OnSelect: Office365.SendEmail(User().Email,"Your Package is on its Way!",txtEmailBody,{Importance: Normal, IsHtml:true, {Attachments:Table({Name:"file1.pdf", ContentBytes:??????.???, '@odata.type':""}) });

 

1) I can't work out what the ContentBytes should be for a PDF;

2) Where should I put the "file1.PDF" so that SendMail can find it?

 

All of the excellent examples I've found demonstrate how to send a pic from a camera.

 

Thank you in advance.

Chris

Categories:
  • ChrisChong Profile Picture
    ChrisChong on at
    Re: How to email a PDF file using SendMail?

    Thanks for thinking about this. It is the 'workaround' I've resorted to: SendMail to the current user who then has to manually attach the PDF and resend. Not really elegant, is it, not to mention error prone--since the App is even more dependent on user.

     

    It's hard to believe that this is such an unusual request--attaching a PDF in much the same way one might attach a .jpg.  But there it is. I am confident that the PowerApps gods are working feverishly on a good solution--but there are probably many other "good" ideas on which they work.

     

    Thanks for your help.  And to all the others who have applied some thought to this current PowerApp deficiency.

  • PK_Hong Profile Picture
    PK_Hong 337 on at
    Re: How to email a PDF file using SendMail?

    Hi @ChrisChong

     

    Just wonder, can you Launch(email) and then attach PDF out of PowerApps?

    I know this is not the right method, but at least a workaround, if you wish to.

    Thanks

  • ChrisChong Profile Picture
    ChrisChong on at
    Re: How to email a PDF file using SendMail?

    Thanks for asking. The source of my PDF: SharePoint.

  • seadude Profile Picture
    seadude 1,855 on at
    Re: How to email a PDF file using SendMail?

    Good question! What is the data source (where are you getting this PDF)?

  • ChrisChong Profile Picture
    ChrisChong on at
    Re: How to email a PDF file using SendMail?

    Thank you for your response. You could be right what you describe as an issue.  However, the 'workaround' you suggest does not work for me. I have a PDF I would like to include in an email generated by my App.

     

    Perhaps the lack of a workable response is an indication that it cannot currently be done?

     


    @v-micsh-msft wrote:

    Hi @ChrisChong,

     

    I think the issue here is there is no file uploader available in PowerApps.

    So it is not available for PowerApps to get the actual PDF file content.

     

    For a workaround, read the following blog and see if it helps in your scenario:

    Convert PowerApps data to PDF and send it as an email

     

    Regards,

    Michael


     

  • v-micsh-msft Profile Picture
    v-micsh-msft on at
    Re: How to email a PDF file using SendMail?

    Hi @ChrisChong,

     

    I think the issue here is there is no file uploader available in PowerApps.

    So it is not available for PowerApps to get the actual PDF file content.

     

    For a workaround, read the following blog and see if it helps in your scenario:

    Convert PowerApps data to PDF and send it as an email

     

    Regards,

    Michael

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard