cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

save email as pdf

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.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

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

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

37 REPLIES 37
v-xida-msft
Community Support
Community Support

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

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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?

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

 

 

 

 

 

 

 

 

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?

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





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





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

 

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?

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. 


@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 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 visualizati...

My converted email is cutoff. Anyone else experience this?

Cutoff Email.jpg

 

It seems that the actual buit-in "convert file" node is not capable of rendering an Email correctly and then export it to PDF.

 

Of course, this is not very simple, because the "convert file" connector needs some good and intelligent renderer. To render a email like a Email program and show most important peaces of the header.

Also convert file lacks some options, like "load embedded images", "page size", etc.

 

I updated the flow idea with some details:

https://powerusers.microsoft.com/t5/Flow-Ideas/Export-Email-to-PDF-format-or-convert-eml-file-to-PDF...

 

Thanks, great post!  I want to do this exact same thing except in a SharePoint Online library.  Can this be done?  I'm getting a 'bad request' error at the conversion step.  Any help would be appreciated.

 

{
"status": 400,
  "message": "The file id '%252fPNC%252fReport%2bFrom%2bEmployer_%2bscott%2bsmith.eml' is not valid.",
  "source": "api.connectorp.svc.ms"
}
 
convert error.JPG
 

 

 

This is great!  Is it possible to only create the pdf using the Body of the email.  I don't require the header. Thx!

Did you ever get this fixed?  I have the email populating with two columns, and the cells wrap in Outlook, but not when exporting to PDF.  It centers everything and pushes words off the left and right side of the page.

I've written a blog post to which shows how to actually include the embedded images on the PDF with PowerAutomate using API conversion service from ConvertAPI. If you have resources & skillset, you can write your own conversion service in Azure which can then be called in PowerAutomate, have provided insights on the blog post. Find below the link to the blog post:

https://ashiqf.com/2020/06/19/convert-outlook-email-with-embedded-images-to-pdf-using-powerautomate/

Hope this helps someone.

@ashiqf :
Thank you. I would love to do this with existing original MS Flow Actions, but as we know, they are to limited. I hope MS will bring a solution by itself in the feature.

 

Nevertheless, a very nice Blogpost from you! Do you have a rough estimation, how many "average sized emails with an image" you can convert with a free 1500 seconds plan? How many seconds you consumed for one PDF?

And do they have some possible options, for example to set higher or lower compression? 

 

There are two possibilities to have images in an Email. The image can be embedded directly. Or the image can be a link to a image hosted outside. Do you know if the service handles both situations fine?
HTML is rendered fine?

 

Thanks a lot!

 

I have the exact flow and am getting "Conversion of this file to PDF is not Supported"

Is there a way to have either the PDF (or preferably) the .eml or .msg format of the outlook mail be printed/attached as a page in a section of OneNote? Storage on the OneDrive folder is good, but even better would for my workflow would be to have each e-mail be printed/pasted into its own page within a section of a OneNote notebook.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (1,177)