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.

37 REPLIES 37

Hi @teqs

 

I agree there should be standard action from Microsoft. Find my response to your questions below:

  • I had tested Inline images and also images hosted public, ConvertAPI endpoint was able to convert. PDF was created with the images as expected
  • For 1 PDF with 2 images, it took around 10 seconds
  • For higher or lower compressions, I've not tested it. There are different parameters you can pass on the API endpoint. Check it on the ConvertAPI website.

Again I am not advocating the ConvertAPI, I've just found the free plan thought of consuming it on Flow. You can also host the API in Azure for converting email to PDF with some C# code, there are opensource PDF libraries (PDFSharp, iTextSharp etc) available. 

I am trying to convert the time stamped on the converted email section "Sent On" . I was able to convert from UTC to my time zone (using the convert time zone connector after the "When a new email arrives" trigger) which i used for the PDF name but i'm curious if there is a way to convert and paste the updated time on the actual PDF. Any thoughts?

 

For example.. here is the time stamp listed on the converted email. It states it came in at 2:16 pm UTC but i need it to be listed as 8:16 am MT. 

aramirez_3_0-1597164889821.png

 

Thank you !

Hi @v-xida-msft ,

 

quick question, our company has an email retention policy of one (1) year, My question: is possible to add a date range or select time period to save all the email under the selected timeframe?

 

I would like for instance have saved all my emails from July. Or even better at the end of July 31st @ 11:59 pm will trigger my flow and start backing up my email from July 1st until July 31st and automatically saving all PDF's in my one drive?

 

Make sense?

 

Thank you kindly for any response

It helped Perfectly...

Thank You for your Help

There might be a work around without resorting to external APIs. I tried converting to HTML instead of PDF to see if embedded images would come up correctly. My flow also saves all attachments, and treated those embedded images as attachments and saved them, which was unexpected but helpful. Looking at the HTML the part where the embedded images are has what looks like a temporary path created during the conversion process. Mine looked like src="C:\SandboxTempLow\as987df6asd876f87asd678f6as89\email_content\image001.png". When I removed the path from the src bit and just had src="image001.png" the HTML file showed the embedded image correctly when open in a web browser.

Perhaps the flow can edit the HTML file and replace the offending src string with the right one and hey presto HTML files show embedded images? Will see how it goes, hope this helps anyone else scratching their heads.

@camerond01Sounds great that you have a possible solution! I quit by trying it for a time by myself. 😞
It would be perfect if you could share your full flow when it works with different emails. Here is also a topic where your solution would be extremely interesting for people: : 

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

The flow starts about the same as the accepted solution, but with a parallel workflow to also save each attachment:

 

camerond01_0-1637546242490.png

 

From there it gets messy:

 

camerond01_1-1637546340979.png

 

I had to escape the backslashes in the HTML source, changing "C:\blah\blah\" to "C:\\blah\\blah\\". For each email attachment looks like this:

 

camerond01_2-1637546464529.png

 

camerond01_3-1637546499637.png

That's right, we're calling a Javascript function inside an Excel spreadsheet residing on OneDrive from a Flow. Because Flow's don't have regex built in, and I guess that MS don't want to cannibalise serverless functions revenue. Got the idea from here: How to use Regex in Power Automate (tachytelic.net)

 

Except nothing ever works the first time and I had to write a test harness to work out the bit with escaping the backslashes. Out of an abundance of caution I concat'd the attachment name into the variables being passed. Javascript is as per the above link.

 

If something like this comes up again I'm going to stand up an API endpoint on my public facing server and just make calls to that and deal with everything at my end and send back results, because quite frankly this is a ridiculous solution to a stupid problem. I mean yeah it works, but at what cost.

Anonymous
Not applicable

has anyone had issues with this flow with external email address, gmail or not office 365 accounts? is there a solution? 

Users can read this blog to save Outlook email as PDF. This blog has explained the two types of solutions, manual and professional methods. Both methods are helpful and perform successfully. So read the blog carefully and get these solutions. 

If you want to save Outlook emails as PDF, read this article. It has explained the best techniques via manual and automated methods. All the methods are very efficient to perform. But many non-technical users may not perform the manual approach. So they can go with the professional method.

teqs
Kudo Commander
Kudo Commander

Built-in solution to convert Emails to PDF stops working because "Convert file", which is used to convert to PDF, is not accepting "*.eml" anymore. It delivers an error message.

 

 

{
  "status": 406,
  "message": "Conversion of this file to PDF is not supported. (Sandbox_BadArgument_ArgumentNull / An exception occurred while executing within the Sandbox)",
  "source": "api.connectorp.svc.ms"
}

 

 

I tried to simply change the exported email from *.eml to *.html, but with *.html the conversion of email with "Convert file" is not working well. It does not identify the email header and display it correctly anymore.

Is there any currently working solution to export incoming emails to PDF with built-in Power Automate nodes?

 

@v-xida-msft: I see you are "Community Support" and posted the solution ( https://powerusers.microsoft.com/t5/Building-Flows/save-email-as-pdf/m-p/109222/highlight/true#M1071... )

Would be very nice if you could communicate with MS that your posted solution is working again. As I described, "Convert file" is not able to convert EML to PDF anymore. Thank you!

 

elizabds
Regular Visitor

This accepted solution works for me and the explanation about the final deletion step was helpful too. I changed 'Received time' to 'subject' since it works better for our team. I've been troubleshooting and LOOKING for this solution for a while. Great forum. Thank you!!

teqs
Kudo Commander
Kudo Commander

Hello @elizabds

 I hope you don't mind me asking a quick question. As in the accepted solution, you did a "Create File" of the incoming email-body to a *.eml-file. And from this "Create File" you placed the ID (result) into the "Convert File" as input?


This had not worked for me in the last weeks anymore, because "Convert File" threw an Error ("Conversion of this file to PDF is not supported") with a *.eml file. If this now works again, I will try to change it again next week. Just want to be sure it's the same solution.

Thanks a lot!

teqs
Kudo Commander
Kudo Commander

I tested today, and as @elizabds said already, the Email->*.eml->*.pdf workflow is working again. Still same problems as before, no images as example, but I do not get an error anymore when the "Convert file" input is named with extension *.eml.
Perhaps it's related to email content, i don't know. Or MS has fixed the isssue I postetd 3 posts before.
Anyway, seems to work fine again. Thanks!

Ok, so just to be clear, there's currently no way to do this via the built in actions? Like other said, i can get the eml > pdf conversion, but it doesn't export the images with it.


@ayomalireid wrote:

Ok, so just to be clear, there's currently no way to do this via the built in actions? Like other said, i can get the eml > pdf conversion, but it doesn't export the images with it.


Yes, unfortunately, that's how it is.

It successfully converted the EML to PDF, but when I tried to open the converted email to PDF, it said something was wrong and it wouldn't open using Acrobat or Microsoft Edge.

Currently having this issue too. Did you ever find a workaround?

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,405)