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 Automate
Answered

save email as pdf

(5) ShareShare
ReportReport
Posted on by 10

Let us save an email as PDF document when using outlook.com or 365.

 

For example I would like to set up a flow that lets me archive all emails that come are put into a certain folder as PDFs to my OneDrive. From what I see this does not seem to be possible as of right now.

Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Qwertworks,

     

    Do you want to save the incoming emails as PDF documents into your OneDrive folder?

     

    I have made a test on my side and please take a try with the following workaround:

    • Add a "When a new email arrives" trigger.
    • Add a "Export email" action, Message Id field set to Message Id dynamic content of the trigger.
    • Add a "Create file" action of OneDrive connector, specify Folder Path, File Name field set to Received Time dynamic content.eml, File Content field set to output of "Export email" action.
    • Add a "Convert file" action, File field set to Id dynamic content of the "Create file" action, Target type set to PDF.
    • Add a "Create file 2" action, specify Folder Path, File Name field set to Received Time dynamic content.pdf, File Content field set to File content dynamic content of the "Convert file" action.
    • Add a "Delete file" action, File field set to Id dynamic content of the "Create file" action.

    Image reference:19.JPG

     

    20.JPG

    The flow works successfully as below:21.JPG

     

    22.JPG

     

     

    The PDF file opens well as below:23.JPG

     

     

    More details about creating a email message (.eml or .msg) file, please check the following article:

    https://flow.microsoft.com/en-us/blog/outlook-connector-more/

     

     

    Best regards,

    kris

  • BSWatkins Profile Picture
    4 on at

    I've got this working except the last step. Instead of deleting the .eml file, it deletes the .pdf file and retains the .eml.

    Any thoughts?

  • creightons Profile Picture
    6 on at

    When you select the Id for the file to delete in the last step, it needs to be from the original Create file step in the Flow (which creates the .eml file) NOT the Create file 2 step (which creates the .pdf file). When you create the Delete file step, the dynamic content starts with Create file 2 since that was the most recent step:

    List of dynamic content from Create file 2 stepList of dynamic content from Create file 2 step

     

    But if you scroll down further, you should be able to select the file ID from the original Create file step and delete that file instead.

    Dynamic content from the original Create file stepDynamic content from the original Create file step

     

     

     

     

     

     

     

     

  • JAH313 Profile Picture
    2 on at

    I get this to work perfectly when testing it with messages already in Office356, but it will not run automatically when I send a test message to the inbox. I do have the flow set to "When New Email Arrives" and the inbox. 

     

    Any ideas?

  • Dorul Profile Picture
    340 on at

    Hi @v-xida-msft

    Works great, flow succeeded but it doesnt delete the .eml file at last step.

    Any idea why? I also tried to insert the ID from pdf file, which works but with the ID from step Create file, it doesnt delete the saved mail.

    Thank you

     

    EDIT: actually it works, but only if someone else is sending the emails to me. I was testing sending mails to myself, in that case it doesnt delete the .eml files

  • MWISE Profile Picture
    29 on at

    Hello,

     

    I was able to get the flow to work and have the files delete as they should. I ran into an issue when trying emails like those from Uber or Lyft. The images are not being converted in the PDF. Any idea of what can be done?

     

    ThanksOutlook-PDF-Flow.png

     

  • danjonwig17 Profile Picture
    8 on at

    I’m having exactly the same issue, embedded graphics aren’t being saved. I tried sending an email from outlook mobile on iOS with a single photo embedded, got only a little red x in the PDF file. Anyone fine a solution?

  • MWISE Profile Picture
    29 on at

    I opened a ticket with Microsoft and was told that the Flow is working as expected and that the images aren't supported at this time. 

  • teqs Profile Picture
    103 on at

    @MWISE wrote:

    I opened a ticket with Microsoft and was told that the Flow is working as expected and that the images aren't supported at this time. 


    I am not sure if this answer of MS makes sense. If embedded images and HTML is not included in the email export, then it is no full email export. Everything in the email, has to be in the email pdf export of course. I tried to export some HTML Emails with this method and after converting HTML elements and images are missing. Nowadays many emails use HTML and embedded image.

     

    I will open a new flow idea to get a connector which can handle Emails to PDF Exports.

  • teqs Profile Picture
    103 on at

    @teqs wrote:

     

    I will open a new flow idea to get a connector which can handle Emails to PDF Exports.

    Here it is:

    Export Mail to PDF format or convert .eml file to PDF including embedded images and HTML visualization

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard