Okay, so you are examining the box, and not connecting to the mail server, right? As I say, look at the box -- it is just a plain text file you can parse yourself.
Originally Posted by P3R3
Here's a clue: messages that contain images will have a line like this:
And the image part of the message will be introduced like this:
There are some complex considerations you will probably have to learn as you go along -- this is NOT a totally trivial task. BTW, if you see stuff like this:
That is image data.