XtremeDocumentStudio
.NET
PDFOne
.NET
XtremeDocumentStudio
(for Java)
PDFOne
(for Java)
XtremeDocumentStudio
Delphi
eDocEngine
VCL
PDFtoolkit
VCL
StarDocs
Web APIs

Gnostice Blog

Friday, May 29, 2015

How to recover file attachments from an e-mail without an e-mail program

Why without an e-mail program? Because it is possible.

By V. Subhash

Recently, I had to test a program that sent e-mail attachments. I used the mailinator.com service for this. (Mailinator provides disposable e-mail addresses without having to sign up first.)

Mailinator displayed the e-mail all right but does not allow attachment downloads. It does provide a plain text view of the email. (All e-mail programs and web mail providers provide this option. You will have to search for it.) I could have saved the whole plain text version in a file with an EML extension and then viewed it in an e-mail program but I decided to take a more difficult route.

Email is all plain text. Even the attachments are encoded as plain text, usually in base64. First, I grabbed the text block marked as the attachment.

Then, I went to an online base64 converter. (It could be this - http://www.motobit.com/util/base64-decoder-encoder.asp)

There, I chose "decode" option and let the decoded content be downloaded as a file. I renamed the file with the proper extension and I was then able to open it in its default program.

Base64 encoding is used in other places as well. Many web services use it to encode images within the content rather than hosted at some URL. In HTML, you just need to prefix the base64 encoding of an image with "data:image/gif;base64," (Yes, that last comma is required.) You could go to http://www.base64-image.de/ to convert your images to base64 and embed them in HTML or CSS.

Privacy | Legal | Feedback | Newsletter | Blog | Resellers © 2002-2018 Gnostice Information Technologies Private Limited. All rights reserved.