Can we convert .eml file to pdf , .docx or any image format

palak agarwal 1 Reputation point
2021-12-10T10:50:19.877+00:00

I am fetching the email from exchange server through graph api and then saving it to .eml , for which i didn't got any way to directly convert it into pdf , .docx or any image format . But while going through outlook when we open any message and go to FILE ->Print -> print to pdf is available . is there any api that directly give me this pdf or any other method or script that can be implemented in c# . Constraint here is we need exact screenshot of the whole message.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,652 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,152 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 86,406 Reputation points
    2021-12-10T10:59:57.127+00:00

    You can read .eml files with IMimeMessage
    (I had posted a sample (in VB, easy to convert into C#) in this thread : Parse / View .eml files in my own app)

    0 comments No comments

  2. levi garcia 0 Reputation points
    2024-12-25T07:16:24.7666667+00:00

    To convert EML to PDF file format, using TrustVare EML to PDF Converter Software. This tool converts your bulk EML files into PDF file format. This application is migrate all emails from Windows Live Mail files into PDF File format with Attachments. It also supports all Windows OS and MS Outlook versions. Download the free demo versions.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.