How to Convert an Outlook EML File to JPG in JavaScript

Cloudmersive
2 min readAug 3, 2021

--

Need to share an email file with a partner who doesn’t have Outlook? While the EML format is compatible with some other programs and systems, you may not want to risk the delay incompatibility issues can cause. Converting your EML file to the JPG format will increase your file compatibility and offer a more compact and customizable vehicle for the information. Instead of performing a manual conversion that could eat up a lot of your productivity time, we will demonstrate how you can use an API in JavaScript to instantly convert the EML file to an array of JPG/JPEG images.

To begin the process, we will run this command to install jQuery:

bower install jquery

After the installation, we will call the conversion function with the following code:

var form = new FormData();
form.append("inputFile", fileInput.files[0], "file");
var settings = {
"url": "https://api.cloudmersive.com/convert/eml/to/jpg",
"method": "POST",
"timeout": 0,
"headers": {
"quality": "<integer>",
"Content-Type": "multipart/form-data",
"Apikey": "YOUR-API-KEY-HERE"
},
"processData": false,
"mimeType": "multipart/form-data",
"contentType": false,
"data": form
};
$.ajax(settings).done(function (response) {
console.log(response);
});

Done! To retrieve your API key, head over to the Cloudmersive website and register for a free account; this provides 800 monthly calls across any of our APIs.

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

No responses yet