Our Email Extractor API is designed for small and big businesses that need an efficient Web API to extract emails. It is secure, fast, and easy to use when you want to extract email, get email information, or extract attachments.
The Email Extractor API can decode emails and extract emails with attachments. These emails can be parsed by its individual parts such as the name and email address of the sender, name and email address of the recipient, body of the email, subject, etc.
The Web API can merge the emails and their attachments into a single PDF document. The email to PDF conversion’s supported source files are .EML and .MSG.
Aside from email parsing and email to PDF conversion, it also has a standalone email attachment extractor that separates the attachments from the email and returns them as downloadable files.
Email Extractor API Benefits
Merge Emails and Attachments
The Email Extractor API extracts, converts, and merges the email and its attachment into a single PDF document.
Decode Email
The Email Extractor API can decode an email and generate a JSON file that contains the individual parts of an email. These parts are separated as their own JSON object to easily reference them.
Extract Attachments
The Email Extractor API can extract the email attachments and generate temporary links to download them individually.
Security
When using our email extractor Web APIs, your data is sent to secure Amazon AWS servers using SSL/TLS encryption. To learn more about PDF.co security, please check out our Security page https://pdf.co/security
Web API Supports Multiple Languages
PDF.co platform can be used by software developers from programming languages such as PHP, Javascript, .NET and ASP.NET, C#, Java, Visual Basic, and many others. Find source code samples in our API documentation.
Access to Integrations
Email Extractor on our PDF.co platform also works via integration on different business automation platforms. They include Zapier and Integromat, UiPath, and BluePrism. You can easily use 300+ API integrations to connect with the most popular applications.
Email Extractor API Samples & Demo
In this demonstration, we will convert and merge an email with attachments into a PDF using the /v1/pdf/convert/from/email endpoint. Our sample email is in the .EML format and contains 2 PDF email attachments.
Following are images of the input .EML file and the output PDF document.
Images of the input EML file and the output PDF
Let’s go over the /v1/pdf/convert/from/email endpoint’s parameters and their corresponding functions real quick.
Endpoint
URL: | https://api.pdf.co/v1/pdf/convert/from/email |
Method: | POST |
Parameter | Description |
url | required. Link to input EML or MSG file to be converted. |
embedAttachments | optional. True by default. |
convertAttachments | optional. true by default. |
margins | optional. set to css style margins like 10px, 5mm, 5in for all sides. |
paperSize | optional. Can be Letter, A4, A5, A6 or custom size. |
orientation | optional. set to Portrait or Landscape. Portrait by default. |
async | optional. Set to true to run as async job in background. |
profiles | optional. Must be a String. Set custom configuration. See profiles examples here |
cURL Code Snippet
curl --location --request POST 'https://api.pdf.co/v1/pdf/convert/from/email' \ --header 'x-api-key: {{x-api-key}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/email-to-pdf/sample.eml", "embedAttachments": true, "convertAttachments": true, "paperSize": "Letter", "name": "email-with-attachments", "async": false, "encrypt": false }'
The Email to PDF API cURL source code samples are available here.
Let’s see the Email to PDF Web API in action.
Email to PDF API in action
The Email to PDF API JavaScript source code samples are available here.
The Email to PDF API PHP source code samples are available here.
The Email to PDF API Python source code samples are available here.
The Email to PDF API Java source code samples are available here.
The Email to PDF API C# source code samples are available here.