Sample code for 30+ languages & platforms
Node.js

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 Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var success = false;

    var email = new chilkat.Email();
    success = email.LoadEml("qa_data/eml/sample.eml");

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

    // Load the MIME object from the StringBuilder
    var mime = new chilkat.Mime();
    success = mime.LoadMimeSb(sbMime);

    console.log(mime.GetMime());

}

chilkatExample();