Sample code for 30+ languages & platforms
Java

Load MIME Object from Email Object

See more Email Object Examples

Demonstrates how to load a Chilkat Mime object from a Chilkat Email object. (Copies the email into a Mime object.)

Chilkat Java Downloads

Chilkat2 Java
import com.chilkatsoft.chilkat2.Email;
import com.chilkatsoft.chilkat2.Mime;
import com.chilkatsoft.chilkat2.StringBuilder;

public class ChilkatExample {

    public static void main(String[] args) {
        Email email = new Email();
        email.loadEml("qa_data/eml/sample.eml");

        // Write the full MIME of the email to a StringBuilder.
        StringBuilder sbMime = new StringBuilder();
        email.getMimeSb(sbMime);

        // Load the MIME object from the StringBuilder
        Mime mime = new Mime();
        mime.loadMimeSb(sbMime);

        System.out.println(mime.getMime());
    }
}