The Mime4j distribution includes samples which demonstrate how the library could be used. This section gives you a short review of those samples. For more information you should download the distribution and study the sample sources. The samples are in the examples/ sub-directory.

Sample Description
org.apache.james.mime4j.samples.tree.MessageTree Displays a tree of the contents of a Mime4j Message object in a Swing GUI. To try it out run
java org.apache.james.mime4j.samples.tree.MessageTree path/to/message.msg
The output is very useful if you want the study the structure of MIME messages.
org.apache.james.mime4j.samples.transform.TransformMessage Illustrate how to transform a message into another message without modifying the original.
org.apache.james.mime4j.samples.dom.TextPlainMessage Illustrate the use of Mime4j DOM API. This example generates a message very similar to the one from RFC 5322 Appendix A.1.1.
org.apache.james.mime4j.samples.dom.MultipartMessage Illustrate the use of Mime4j DOM API. This example creates a multipart/mixed message that consists of a text/plain and an image/png part. The image is created on the fly; a similar technique can be used to create PDF or XML attachments, for example.