How to get the message body only of an email?

There is different way of sending email, some send it in text only others in both text & html. It become more difficult to extract these messages.

Is there a tool I can use to get it?


Posted on 2002-09-03 12:13:58 by Guy

I'm assuming you are trying to retrieve the text only portion of the email from the email message source. If you look at the source for this kind of email, it will include the following line:

Content-Type: multipart/alternative;

This tells your email reader that there are more than one "part" to the email and that it may have to process only one. The text part of the email is usually first followed by the HTML part which are separated by a "boundary"

You can find this by searching for the text:


This will quite often be a very strange string. This boundary string is used to separate different "Content-Type" sections, for instance text/plain, text/html A good reason for having both plain and html sections is so that with one e-mail a user with a plain text e-mail program can view the text and a user with a graphical email program can see the html "page"

So to retrieve the text only portion, select the text after the line


and a blank line and before the next "boundary"


Posted on 2002-09-04 04:06:49 by farrier